A class for logging to ostreams. More...
#include <Logger.h>
Public Member Functions | |
LogStream (std::ostream &destination) | |
LogStream (std::ostream &destination, const std::string &locale) | |
virtual void | log (const LogMessage &message) |
A class for logging to ostreams.
This class is used for logging to ostreams (cout, cerr, files). It provides synchronization in order to prevent different LogMessages to appear mixed with each other in the stream. In order not to break the synchronization, LogStreams should never be copied. Therefore the copy constructor and assignment operator are private. Furthermore, it is important to keep a LogStream object as long as the Logger to which it has been registered.
Arc::LogStream::LogStream | ( | std::ostream & | destination | ) |
Arc::LogStream::LogStream | ( | std::ostream & | destination, | |
const std::string & | locale | |||
) |
virtual void Arc::LogStream::log | ( | const LogMessage & | message | ) | [virtual] |
Writes a LogMessage to the stream.
This method writes a LogMessage to the ostream that is connected to this LogStream object. It is synchronized so that not more than one LogMessage can be written at a time.
message | The LogMessage to write. |
Implements Arc::LogDestination.