simulation_framework::core::logging::LoggingInstance Class Reference
Last update: 19.09.2025A singleton class to be used for all logging purposes. It can be used to register additional loggers based on the ILogger class to introduce additional logging mechanisms. By default a ConsoleLogger will be registered with each new LoggingInstance. If logging to console is not desired in your use case, you can call ClearLoggers() before adding your custom loggers to disable console logging. More...
#include <logging.h>
Public Types | |
| using | ILoggerContainer = std::vector< std::unique_ptr< ILogger > > |
Public Member Functions | |
| LoggingInstance (const LoggingInstance &)=delete | |
| LoggingInstance & | operator= (const LoggingInstance &)=delete |
| void | RegisterLogger (std::unique_ptr< ILogger > logger) |
| Register a new logger. | |
| void | ClearLoggers () |
| Remove all currently registered loggers. | |
| const ILoggerContainer & | GetLoggers () const |
| Return a const reference to the container of registered loggers. | |
| void | Log (LogLevel level, std::string_view message) |
| Log a message on the logging interface. | |
| void | SetLogLevel (LogLevel log_level) |
| Set Log level of all registered loggers. | |
Static Public Member Functions | |
| static LoggingInstance & | GetInstance () |
| Returns a reference to global singleton logging instance. | |
Detailed Description
A singleton class to be used for all logging purposes. It can be used to register additional loggers based on the ILogger class to introduce additional logging mechanisms. By default a ConsoleLogger will be registered with each new LoggingInstance. If logging to console is not desired in your use case, you can call ClearLoggers() before adding your custom loggers to disable console logging.
Member Typedef Documentation
◆ ILoggerContainer
Member Function Documentation
◆ ClearLoggers()
|
inline |
◆ GetInstance()
|
inlinestatic |
◆ GetLoggers()
|
inline |
◆ Log()
|
inline |
◆ RegisterLogger()
◆ SetLogLevel()
|
inline |
The documentation for this class was generated from the following file: