Arc::LogMessage Class Reference

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)

Detailed Description

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.


Constructor & Destructor Documentation

Arc::LogMessage::LogMessage ( LogLevel  level,
const IString message 
)

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.

Parameters:
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.

Parameters:
level The level of the LogMessage.
message The message text.
ident The identifier of the LogMessage.

Member Function Documentation

LogLevel Arc::LogMessage::getLevel (  )  const

Returns the level of the LogMessage.

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.

Parameters:
The identifier.

Friends And Related Function Documentation

friend class Logger [friend]

The Logger class is a friend.

The Logger class must have some privileges (e.g. ability to call the setDomain() method), therefore it is a 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.


The documentation for this class was generated from the following file:
Generated on Wed Jun 27 11:54:21 2012 for Hosting Environment (Daemon) by  doxygen 1.6.3