ARC SDK
Public Member Functions | Protected Member Functions | Friends
Arc::LogMessage Class Reference

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

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

◆ LogMessage() [1/2]

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
levelThe level of the LogMessage.
messageThe message text.

◆ LogMessage() [2/2]

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
levelThe level of the LogMessage.
messageThe message text.
identifierThe identifier of the LogMessage.

Member Function Documentation

◆ getLevel()

LogLevel Arc::LogMessage::getLevel ( ) const

Returns the level of the LogMessage.

Returns the level of the LogMessage.

Returns
The level of the LogMessage.

◆ setIdentifier()

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
identifierThe identifier.

Friends And Related Function Documentation

◆ Logger

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.

◆ operator<<

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: