A class for log messages. More...
#include <Logger.h>
Public Member Functions | |
LogMessage (LogLevel level, const IString &message) | |
LogMessage (LogLevel level, const IString &message, const std::string &identifier) | |
LogLevel | getLevel () const |
Protected Member Functions | |
void | setIdentifier (std::string identifier) |
Friends | |
class | Logger |
std::ostream & | operator<< (std::ostream &os, const LogMessage &message) |
A class for log messages.
This class is used to represent log messages internally. It contains the time the message was created, its level, from which domain it was sent, an identifier and the message text itself.
Creates a LogMessage with the specified level and message text.
This constructor creates a LogMessage with the specified level and message text. The time is set automatically, the domain is set by the Logger to which the LogMessage is sent and the identifier is composed from the process ID and the address of the Thread object corresponding to the calling thread.
level | The level of the LogMessage. | |
message | The message text. |
Arc::LogMessage::LogMessage | ( | LogLevel | level, | |
const IString & | message, | |||
const std::string & | identifier | |||
) |
Creates a LogMessage with the specified attributes.
This constructor creates a LogMessage with the specified level, message text and identifier. The time is set automatically and the domain is set by the Logger to which the LogMessage is sent.
level | The level of the LogMessage. | |
message | The message text. | |
ident | The identifier of the LogMessage. |
LogLevel Arc::LogMessage::getLevel | ( | ) | const |
Returns the level of the LogMessage.
Returns the level of the LogMessage.
void Arc::LogMessage::setIdentifier | ( | std::string | identifier | ) | [protected] |
Sets the identifier of the LogMessage.
The purpose of this method is to allow subclasses (in case there are any) to set the identifier of a LogMessage.
The | identifier. |
friend class Logger [friend] |
std::ostream& operator<< | ( | std::ostream & | os, | |
const LogMessage & | message | |||
) | [friend] |
Printing of LogMessages to ostreams.
Output operator so that LogMessages can be printed conveniently by LogDestinations.