Add a note about the assumptions made by Log::writeToStream() with respect to multiple logging processes' clobbering each other's output.

This commit is contained in:
Robert Knight 2011-09-02 23:41:02 +01:00
parent 9c260bc114
commit e9c94e99ad

View file

@ -31,6 +31,12 @@ void Log::open(const std::string& path)
void Log::writeToStream(std::ostream& stream, Type type, const char* text) void Log::writeToStream(std::ostream& stream, Type type, const char* text)
{ {
// Multiple processes may be writing to the same log file during
// an update. No attempt is made to synchronize access to the file.
//
// Under Unix, appends to a single file on a local FS by multiple writers should be atomic
// provided that the length of 'text' is less than PIPE_BUF
//
switch (type) switch (type)
{ {
case Info: case Info: