Class simulation_framework::core::logging::LoggingInstance
Last update: 09.03.2026
Definition: core/logging/logging.h (line 28)
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.
Members
- ClearLoggers
- GetInstance
- GetLoggers
- ILoggerContainer
- Log
- LoggingInstance
- LoggingInstance
- operator=
- RegisterLogger
- SetLogLevel
- ~LoggingInstance
Public types
Typedef ILoggerContainer
Definition: core/logging/logging.h (line 31)
using simulation_framework::core::logging::LoggingInstance::ILoggerContainer = std::vector<std::unique_ptr<ILogger> >
Return type: std::vector< std::unique_ptr< ILogger > >
Public functions
Function ~LoggingInstance
virtual simulation_framework::core::logging::LoggingInstance::~LoggingInstance()=default
Return type:
Function LoggingInstance
simulation_framework::core::logging::LoggingInstance::LoggingInstance(const LoggingInstance &)=delete
Parameters:
Return type:
Function operator=
LoggingInstance & simulation_framework::core::logging::LoggingInstance::operator=(const LoggingInstance &)=delete
Parameters:
Return type: LoggingInstance &
Function RegisterLogger
void simulation_framework::core::logging::LoggingInstance::RegisterLogger(std::unique_ptr< ILogger > logger)
Register a new logger.
Parameters:
- logger: The logger to be registered
Parameters:
- std::unique_ptr< ILogger > logger
Return type: void
Function ClearLoggers
void simulation_framework::core::logging::LoggingInstance::ClearLoggers()
Remove all currently registered loggers.
Return type: void
Function GetLoggers
const ILoggerContainer & simulation_framework::core::logging::LoggingInstance::GetLoggers() const
Return a const reference to the container of registered loggers.
Return type: const ILoggerContainer &
Function Log
void simulation_framework::core::logging::LoggingInstance::Log(LogLevel level, std::string_view message)
Log a message on the logging interface.
Parameters:
- level: The log level of the message
- message: The log message
Parameters:
- LogLevel level
- std::string_view message
Return type: void
Function SetLogLevel
void simulation_framework::core::logging::LoggingInstance::SetLogLevel(LogLevel log_level)
Set Log level of all registered loggers.
Parameters:
- level: The log level of the message
Parameters:
- LogLevel log_level
Return type: void
Public static functions
Function GetInstance
static LoggingInstance & simulation_framework::core::logging::LoggingInstance::GetInstance()
Returns a reference to global singleton logging instance.
Return type: LoggingInstance &