Class Logger.

Inherits Garbage. Inherited by StderrLogger.

Abstract base class for things that log messages.

All subclasses of Logger must implement the send() virtual function, and take responsibility for correctly logging the lines of text that are passed to it.

A program creates one instance of a Logger subclass at startup and uses Logger::global() to process any messages sent to a Log object thereafter.

Logger::Logger()

Stores the address of the newly-created Logger for global().

Reimplements Garbage::Garbage().

static Logger * Logger::global()

Returns a pointer to the global Logger.

String Logger::name() const

Returns an application name. Subclasses must provide this name.

I don't like this mechanism. It's hacky. Only exists to let Log (in core) get at information held by the Server class (in server).

void Logger::send( const String & id, Log::Facility f, Log::Severity s, const String & m )

This virtual function logs the message m belonging to transaction id, whose severity is s and which is logged by f, in a manner decided by the subclass.

id uniquely identifies a Log object.

Logger::~Logger()

This virtual destructor exists only to ensure that global() doesn't return a bad pointer.

This web page based on source code belonging to Oryx Mail Systems GmbH. All rights reserved.