ARC SDK
|
A class for log messages. More...
#include <arc/Logger.h>
Public Member Functions | |
LogMessage (LogLevel level, const IString &message) | |
Creates a LogMessage with the specified level and message text. More... | |
LogMessage (LogLevel level, const IString &message, const std::string &identifier) | |
Creates a LogMessage with the specified attributes. More... | |
LogLevel | getLevel () const |
Returns the level of the LogMessage. More... | |
Protected Member Functions | |
void | setIdentifier (std::string identifier) |
Sets the identifier of the LogMessage. More... | |
Friends | |
class | Logger |
The Logger class is a friend. More... | |
std::ostream & | operator<< (std::ostream &os, const LogMessage &message) |
Printing of LogMessages to ostreams. More... | |
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. |
identifier | The identifier of the LogMessage. |
LogLevel Arc::LogMessage::getLevel | ( | ) | const |
Returns the level of the LogMessage.
Returns the level of the LogMessage.
|
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.
identifier | The identifier. |
|
friend |
|
friend |
Printing of LogMessages to ostreams.
Output operator so that LogMessages can be printed conveniently by LogDestinations.