Centralized class to collect all log messages and relay them to the registered observers. The Logger is implemented as a singleton.
More...
#include <Logger.hpp>
|
| static Logger * | getInstance () noexcept |
| | Get a pointer to the instance of the Logger singleton.
|
Centralized class to collect all log messages and relay them to the registered observers. The Logger is implemented as a singleton.
◆ getInstance()
| Logger * eduart::logger::Logger::getInstance |
( |
| ) |
|
|
staticnoexcept |
Get a pointer to the instance of the Logger singleton.
- Returns
- Pointer to the Logger instance
◆ log() [1/2]
| void eduart::logger::Logger::log |
( |
const LogVerbosity | verbosity, |
|
|
const std::string & | msg ) const |
Log a message that will be relayed to all registered observers.
- Parameters
-
| [in] | verbosity | Log verbosity of the message |
| [in] | msg | Log message |
- Exceptions
-
◆ log() [2/2]
| void eduart::logger::Logger::log |
( |
const LogVerbosity | verbosity, |
|
|
const std::stringstream & | msg ) const |
Log a message that will be relayed to all registered observers.
- Parameters
-
| [in] | verbosity | Log verbosity of the message |
| [in] | msg | Log message |
- Exceptions
-
◆ subscribe()
Subscribe to log messages.
- Parameters
-
| [in] | callback | Callback function to be called when a log message is received |
- Returns
- RAII Subscription that auto-cancels on destruction
◆ unsubscribe()
Unsubscribe from log messages.
- Parameters
-
| [in] | token | Token returned by subscribe |
The documentation for this class was generated from the following file: