MachineIntelligenceCore:Toolchain
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
mic::logger::Logger Class Reference

Logger - defined in the form of a singleton, with double-checked locking pattern (DCLP) based access to instance. More...

#include <Logger.hpp>

Public Member Functions

void log (const std::string &file, int line, Severity_t sev, const std::string &msg)
 
void addOutput (LoggerOutput *out)
 
void incrementSeverityLevel ()
 
void decrementSeverityLevel ()
 
void setSeverityLevel (Severity_t sev)
 

Static Public Member Functions

static LoggergetInstance ()
 

Private Member Functions

 Logger ()
 

Private Attributes

boost::ptr_vector< LoggerOutputoutputs
 

Static Private Attributes

static boost::atomic< Logger * > instance_
 
static boost::mutex instantiation_mutex
 

Detailed Description

Logger - defined in the form of a singleton, with double-checked locking pattern (DCLP) based access to instance.

Author
tkornuta

Definition at line 47 of file Logger.hpp.

Constructor & Destructor Documentation

mic::logger::Logger::Logger ( )
private

Private constructor.

Definition at line 58 of file Logger.cpp.

Referenced by getInstance().

Member Function Documentation

void mic::logger::Logger::addOutput ( LoggerOutput out)

Adds logger output.

Definition at line 62 of file Logger.cpp.

References outputs.

void mic::logger::Logger::decrementSeverityLevel ( )

Decrements severity level.

Definition at line 83 of file Logger.cpp.

References mic::logger::LoggerOutput::decrementLvl(), and outputs.

Here is the call graph for this function:

Logger * mic::logger::Logger::getInstance ( )
static

Method for accessing the object instance, with double-checked locking optimization.

Returns
Instance of ApplicationState singleton.

Definition at line 37 of file Logger.cpp.

References instance_, instantiation_mutex, and Logger().

Here is the call graph for this function:

void mic::logger::Logger::incrementSeverityLevel ( )

Increments severity level.

Definition at line 78 of file Logger.cpp.

References mic::logger::LoggerOutput::incrementLvl(), and outputs.

Here is the call graph for this function:

void mic::logger::Logger::log ( const std::string &  file,
int  line,
Severity_t  sev,
const std::string &  msg 
)

Logs the message - sends it to registered logger outputs.

Definition at line 67 of file Logger.cpp.

References mic::logger::LoggerOutput::getLvl(), outputs, and mic::logger::LoggerOutput::print().

Referenced by mic::logger::ScopeLogger::~ScopeLogger().

Here is the call graph for this function:

void mic::logger::Logger::setSeverityLevel ( Severity_t  sev)

Set severity level.

Definition at line 89 of file Logger.cpp.

References outputs, and mic::logger::LoggerOutput::setLvl().

Here is the call graph for this function:

Member Data Documentation

boost::atomic< Logger * > mic::logger::Logger::instance_
staticprivate

Private instance - accessed as atomic operation.

Definition at line 86 of file Logger.hpp.

Referenced by getInstance().

boost::mutex mic::logger::Logger::instantiation_mutex
staticprivate

Mutex used for instantiation of the instance.

Definition at line 91 of file Logger.hpp.

Referenced by getInstance().

boost::ptr_vector<LoggerOutput> mic::logger::Logger::outputs
private

List of outputs.

Definition at line 101 of file Logger.hpp.

Referenced by addOutput(), decrementSeverityLevel(), incrementSeverityLevel(), log(), and setSeverityLevel().


The documentation for this class was generated from the following files: