diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-06-19T14·37+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-06-19T14·37+0000 |
commit | 0e783e557941f77d5b4bcf2a6c6423ed583991a2 (patch) | |
tree | 183abb6446b408f4b90b356313d7118ada20808a /src/libutil | |
parent | d7f40357e328c54694edd24e5b2687fe5789528e (diff) |
* Write messages to stderr in a slightly more atomic way. Useful when
there are several parallel processes.
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/util.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 556c3c3a2aa4..973443cf1380 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -401,7 +401,8 @@ void printMsg_(Verbosity level, const format & f) prefix += "| "; else if (logType == ltEscapes && level != lvlInfo) prefix = "\033[" + escVerbosity(level) + "s"; - cerr << format("%1%%2%\n") % prefix % f.str(); + string s = (format("%1%%2%\n") % prefix % f.str()).str(); + writeFull(STDERR_FILENO, (const unsigned char *) s.c_str(), s.size()); } |