The LogDispatcher dispatches generated log messages to all registered log notifiers. When a log message is dispatched a timestamp for log messages and then forwards them to any registered log notifier.
More...
#include "Logger.h"
|
void | setLogFlag (LogFlag _flag, bool _active=true) |
|
void | setLogFlags (LogFlags _flags) |
|
LogFlags | logFlags (void) const |
|
void | setServiceName (const std::string &_name) |
|
const std::string & | serviceName (void) const |
|
void | setUserName (const std::string &_name) |
|
const std::string & | getUserName (void) const |
|
void | setProjectName (const std::string &_name) |
|
const std::string & | getProjectName (void) const |
|
void | addReceiver (AbstractLogNotifier *_receiver) |
| Adds the provided receiver to the message receiver list. Every registered receiver will be notified about every log message that was created.
|
|
void | forgetReceiver (AbstractLogNotifier *_receiver) |
|
void | dispatch (const std::string &_text, const std::string &_functionName=std::string(), const LogFlags &_logFlags=LogFlags(ot::INFORMATION_LOG)) |
| Dispatch a log message with the provided params. Will forward the created log message object to the dispatch(LogMessage) function. Will apply the current user and project names to the log message before dispatching.
|
|
void | dispatch (const LogMessage &_message) |
| Dispatch a log message with the provided params. Will set the current system time as message creation time (local system time). //! Will apply the current user and project names to the log message before dispatching.
|
|
The LogDispatcher dispatches generated log messages to all registered log notifiers. When a log message is dispatched a timestamp for log messages and then forwards them to any registered log notifier.
◆ addFileWriter()
void ot::LogDispatcher::addFileWriter |
( |
void | | ) |
|
|
static |
◆ addReceiver()
Adds the provided receiver to the message receiver list. Every registered receiver will be notified about every log message that was created.
- Parameters
-
_receiver | The receiver to add |
◆ dispatch() [1/2]
void ot::LogDispatcher::dispatch |
( |
const LogMessage & | _message | ) |
|
Dispatch a log message with the provided params. Will set the current system time as message creation time (local system time). //! Will apply the current user and project names to the log message before dispatching.
- Parameters
-
_message | The message to dispatch. |
◆ dispatch() [2/2]
Dispatch a log message with the provided params. Will forward the created log message object to the dispatch(LogMessage) function. Will apply the current user and project names to the log message before dispatching.
- Parameters
-
_text | The message text. |
_functionName | The name of the function. |
_logFlags | The flags that should be set for the log message. |
◆ forgetReceiver()
◆ getProjectName()
const std::string & ot::LogDispatcher::getProjectName |
( |
void | | ) |
const |
|
inline |
◆ getUserName()
const std::string & ot::LogDispatcher::getUserName |
( |
void | | ) |
const |
|
inline |
◆ initialize()
ot::LogDispatcher & ot::LogDispatcher::initialize |
( |
const std::string & | _serviceName, |
|
|
bool | _addCoutReceiver = false ) |
|
static |
◆ instance()
◆ logFlags()
LogFlags ot::LogDispatcher::logFlags |
( |
void | | ) |
const |
|
inline |
◆ mayLog()
static bool ot::LogDispatcher::mayLog |
( |
LogFlag | _flags | ) |
|
|
inlinestatic |
◆ serviceName()
const std::string & ot::LogDispatcher::serviceName |
( |
void | | ) |
const |
|
inline |
◆ setLogFlag()
void ot::LogDispatcher::setLogFlag |
( |
LogFlag | _flag, |
|
|
bool | _active = true ) |
|
inline |
◆ setLogFlags()
void ot::LogDispatcher::setLogFlags |
( |
LogFlags | _flags | ) |
|
|
inline |
◆ setProjectName()
void ot::LogDispatcher::setProjectName |
( |
const std::string & | _name | ) |
|
|
inline |
◆ setServiceName()
void ot::LogDispatcher::setServiceName |
( |
const std::string & | _name | ) |
|
|
inline |
◆ setUserName()
void ot::LogDispatcher::setUserName |
( |
const std::string & | _name | ) |
|
|
inline |
◆ ~LogDispatcher()
ot::LogDispatcher::~LogDispatcher |
( |
| ) |
|
|
privatevirtual |
The documentation for this class was generated from the following files: