#include <Logger.h>
Public Types | |
| enum | severity_level { trace, debug, info, warning, error, fatal } |
Public Member Functions | |
| void | addLogger (const std::string &name, const std::string &filename, std::string format) |
| It sets the logger using a default implementation. More... | |
| void | addLoggerFromFile (const std::string &filename) |
| It sets the logger configuration from a given file. More... | |
| bool | exists (const std::string &name) |
| Checks if exists a logger registered with the given name. More... | |
| void | log (const std::string &message, const std::string &channel, severity_level severity) |
| It logs a given string message, channel and severity. More... | |
| void | removeAllLoggers () |
| It removes all added loggers. More... | |
Static Public Member Functions | |
| static Logger & | instance () |
| It returns a reference to the singleton instance. More... | |
Private Member Functions | |
| Logger () | |
| Singleton constructor must be private or protected. More... | |
| Logger (Logger const &) | |
| Singleton copy constructor must be private or protected. More... | |
| Logger & | operator= (Logger const &) |
| Singleton copy assignment operator must be private or protected. More... | |
| ~Logger () | |
| Singleton destructor must be private or protected. More... | |
Private Attributes | |
| Impl * | m_pimpl |
|
private |
Singleton constructor must be private or protected.
Definition at line 123 of file Logger.cpp.
References m_pimpl.
|
private |
Singleton destructor must be private or protected.
Definition at line 139 of file Logger.cpp.
References m_pimpl.
|
private |
Singleton copy constructor must be private or protected.
| void Logger::addLogger | ( | const std::string & | name, |
| const std::string & | filename, | ||
| std::string | format | ||
| ) |
It sets the logger using a default implementation.
| name | The name of the logger. |
| filename | The name of the log file. |
| format | The format string of the logger. |
| te::InvalidArgumentException | If the logger name is empty or already registered |
Definition at line 84 of file Logger.cpp.
| void Logger::addLoggerFromFile | ( | const std::string & | filename | ) |
It sets the logger configuration from a given file.
| filename | The name of the configuration file. |
| std::exception | If the configuration file is doesn't load. |
Definition at line 66 of file Logger.cpp.
| bool Logger::exists | ( | const std::string & | name | ) |
Checks if exists a logger registered with the given name.
| name | The name to be checked. |
Definition at line 110 of file Logger.cpp.
References m_pimpl.
Referenced by addLogger(), and addLoggerFromFile().
|
static |
It returns a reference to the singleton instance.
Referenced by BOOST_AUTO_TEST_SUITE(), and te::qt::af::ApplicationController::finalize().
| void Logger::log | ( | const std::string & | message, |
| const std::string & | channel, | ||
| severity_level | severity | ||
| ) |
It logs a given string message, channel and severity.
| message | The string message to be logged. |
| channel | The channel name that will receive the message. |
| severity | The severity of the logged message. |
Definition at line 145 of file Logger.cpp.
Singleton copy assignment operator must be private or protected.
| void Logger::removeAllLoggers | ( | ) |
It removes all added loggers.
Definition at line 117 of file Logger.cpp.
References m_pimpl.
Referenced by te::qt::af::ApplicationController::finalize().
|
private |
Definition at line 146 of file Logger.h.
Referenced by addLogger(), addLoggerFromFile(), exists(), log(), Logger(), removeAllLoggers(), and ~Logger().