Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
Logger Class Referenceabstract

The Base Custom Log Handler class. More...

#include <ored/utilities/log.hpp>

+ Inheritance diagram for Logger:
+ Collaboration diagram for Logger:

Public Member Functions

virtual ~Logger ()
 Destructor. More...
 
virtual void log (unsigned level, const std::string &s)=0
 The Log call back function. More...
 
const std::string & name ()
 Returns the Logger name. More...
 

Protected Member Functions

 Logger (const std::string &name)
 Constructor. More...
 

Private Attributes

std::string name_
 

Detailed Description

The Base Custom Log Handler class.

This base log handler class can be used to define your own custom handler and then registered with the Log class. Once registered it will receive all log messages as soon as they occur via it's log() method

See also
Log

Definition at line 130 of file log.hpp.

Constructor & Destructor Documentation

◆ ~Logger()

virtual ~Logger ( )
virtual

Destructor.

Definition at line 133 of file log.hpp.

133{}

◆ Logger()

Logger ( const std::string &  name)
protected

Constructor.

Implementations must provide a logger name

Parameters
namethe logger name

Definition at line 152 of file log.hpp.

152: name_(name) {}
const std::string & name()
Returns the Logger name.
Definition: log.hpp:144
std::string name_
Definition: log.hpp:155

Member Function Documentation

◆ log()

virtual void log ( unsigned  level,
const std::string &  s 
)
pure virtual

The Log call back function.

This function will be called every time a log message is produced.

Parameters
levelthe log level
sthe log message

Implemented in StderrLogger, FileLogger, and BufferLogger.

◆ name()

const std::string & name ( )

Returns the Logger name.

Definition at line 144 of file log.hpp.

144{ return name_; }

Member Data Documentation

◆ name_

std::string name_
private

Definition at line 155 of file log.hpp.