ARC SDK
|
A base class for log destinations. More...
#include <arc/Logger.h>
Public Member Functions | |
virtual void | log (const LogMessage &message)=0 |
Logs a LogMessage to this LogDestination. More... | |
void | setFormat (const LogFormat &newformat) |
Set format for this log destination. More... | |
LogFormat | getFormat () const |
Returns currently assigned format. More... | |
void | setPrefix (const std::string &prefix) |
Set a prefix for this log destination to be logged before messages. More... | |
std::string | getPrefix () const |
Returns currently assignd prefix. More... | |
Static Public Member Functions | |
static void | setDefaultFormat (const LogFormat &newformat) |
Set format for any new log destination. More... | |
static LogFormat | getDefaultFormat () |
Returns currently assigned default format. More... | |
Protected Member Functions | |
LogDestination () | |
Default constructor. Protected since subclasses should be used instead. More... | |
Protected Attributes | |
Glib::Mutex | mutex |
A mutex for synchronization. More... | |
LogFormat | format |
Format to use in this LogDestination. More... | |
std::string | prefix |
Prefix to use in this log destination. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const LogDestination &dest) |
Sets iword and pword for format and prefix. More... | |
A base class for log destinations.
This class defines an interface for LogDestinations. LogDestination objects will typically contain synchronization mechanisms and should therefore never be copied. If setlocale() has been called with a supported locale, log messages will be logged in that locale.
|
protected |
Default constructor. Protected since subclasses should be used instead.
|
static |
Returns currently assigned default format.
LogFormat Arc::LogDestination::getFormat | ( | ) | const |
Returns currently assigned format.
std::string Arc::LogDestination::getPrefix | ( | ) | const |
Returns currently assignd prefix.
|
pure virtual |
Logs a LogMessage to this LogDestination.
Implemented in Arc::LogFile, and Arc::LogStream.
|
static |
Set format for any new log destination.
void Arc::LogDestination::setFormat | ( | const LogFormat & | newformat | ) |
Set format for this log destination.
void Arc::LogDestination::setPrefix | ( | const std::string & | prefix | ) |
Set a prefix for this log destination to be logged before messages.
The prefix is prepended to messages in all formats except EmptyFormat.
|
friend |
Sets iword and pword for format and prefix.
|
protected |
Format to use in this LogDestination.
|
mutableprotected |
A mutex for synchronization.
This mutex is to be locked before a LogMessage is written and it is not unlocked until the entire message has been written and the stream flushed. This is done in order to prevent LogMessages to appear mixed in the stream and prevent race on modification of internal members. It is mutable to provide protection while reading members.
|
protected |
Prefix to use in this log destination.