Logging Service API
SIL Kit provides a Logging service that can be used for writing log messages of specified log levels to files, stdout
or distribute them with remote logging to other simulation participants. The logger can be obtained by calling
GetLogger()
. Refer to Logging Configuration for
how to configure the logging service.
API
-
class ILogger
Public Functions
-
virtual ~ILogger() = default
-
virtual void Log(Level level, const std::string &msg) = 0
Log a message with a specified level.
- Parameters
level – The log level for the message
msg – The message which shall be logged (UTF-8).
-
virtual void Trace(const std::string &msg) = 0
Log a message with log level trace.
-
virtual void Debug(const std::string &msg) = 0
Log a message with log level debug.
-
virtual void Info(const std::string &msg) = 0
Log a message with log level info.
-
virtual void Warn(const std::string &msg) = 0
Log a message with log level warn.
-
virtual void Error(const std::string &msg) = 0
Log a message with log level error.
-
virtual void Critical(const std::string &msg) = 0
Log a message with log level critical.
-
virtual ~ILogger() = default
Data Type Reference
-
enum SilKit::Services::Logging::Level
Information level of a log message.
Values:
-
enumerator Trace
Detailed debug-level messages.
-
enumerator Debug
Normal debug-level messages.
-
enumerator Info
Informational content.
-
enumerator Warn
Warnings.
-
enumerator Error
Non-critical errors.
-
enumerator Critical
Critical errors.
-
enumerator Off
Logging is disabled.
-
enumerator Trace