MachineIntelligenceCore:Toolchain
|
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 Logger * | getInstance () |
Private Member Functions | |
Logger () | |
Private Attributes | |
boost::ptr_vector< LoggerOutput > | outputs |
Static Private Attributes | |
static boost::atomic< Logger * > | instance_ |
static boost::mutex | instantiation_mutex |
Logger - defined in the form of a singleton, with double-checked locking pattern (DCLP) based access to instance.
Definition at line 47 of file Logger.hpp.
|
private |
void mic::logger::Logger::addOutput | ( | LoggerOutput * | out | ) |
void mic::logger::Logger::decrementSeverityLevel | ( | ) |
Decrements severity level.
Definition at line 83 of file Logger.cpp.
References mic::logger::LoggerOutput::decrementLvl(), and outputs.
|
static |
Method for accessing the object instance, with double-checked locking optimization.
Definition at line 37 of file Logger.cpp.
References instance_, instantiation_mutex, and Logger().
void mic::logger::Logger::incrementSeverityLevel | ( | ) |
Increments severity level.
Definition at line 78 of file Logger.cpp.
References mic::logger::LoggerOutput::incrementLvl(), and outputs.
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().
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().
|
staticprivate |
Private instance - accessed as atomic operation.
Definition at line 86 of file Logger.hpp.
Referenced by getInstance().
|
staticprivate |
Mutex used for instantiation of the instance.
Definition at line 91 of file Logger.hpp.
Referenced by getInstance().
|
private |
List of outputs.
Definition at line 101 of file Logger.hpp.
Referenced by addOutput(), decrementSeverityLevel(), incrementSeverityLevel(), log(), and setSeverityLevel().