-
Notifications
You must be signed in to change notification settings - Fork 0
LogLevel
Log levels are used to filter logs by severity level.
The available levels are available through the enum class SA::LogLevel
with the values:
The default level, used for fast debugging.
Initialization/Uninitialization, resource creation/destruction information logging.
Code generated a warning which might cause a potential issue: implementation should be checked.
Error as occurred: serious debugging is required.
Assertion test resulted in success. Exception not thrown but still log the exception to access performed test as a string.
Assertion test resulted in failure. Force log exception despite any parameters before throw.
The functions EnableLogLevel
and DisableLogLevel
are accessible from the Logger class to enable/disable a log level in all registered streams.
Example:
// Disable Warning LogLevel for all streams.
SA::Debug::logger->DisableLogLevel(SA::LogLevel::Warning);
// Enable AssertionSuccess LogLevel for all streams.
SA::Debug::logger->EnableLogLevel(SA::LogLevel::AssertionSuccess);
A levelFlags
is accessible in each LogStream
to control whether or not a log with this level should be output.
Example:
// Create and register LogStream.
SA::ConsoleLogStream& cslStream = SA::Debug::logger->CreateLogStream<SA::ConsoleLogStream>();
// Remove warning level.
cslStream.levelFlags &= ~SA::LogLevel::Warning;
// Add AssertionSuccess level.
cslStream.levelFlags |= SA::LogLevel::AssertionSuccess;