ARC SDK
|
A class for logging to ostreams. More...
#include <arc/Logger.h>
Public Member Functions | |
LogStream (std::ostream &destination) | |
Creates a LogStream connected to an ostream. More... | |
virtual void | log (const LogMessage &message) |
Writes a LogMessage to the stream. More... | |
![]() | |
void | setFormat (const LogFormat &newformat) |
Set format for this log destination. | |
Additional Inherited Members | |
![]() | |
LogDestination () | |
Default constructor. Protected since subclasses should be used instead. | |
![]() | |
LogFormat | format |
Format to use in this LogDestination. | |
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 | ) |
|
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.