Logger2#
Fully qualified name: carb::logging::Logger2
Defined in carb/logging/Logger.h
-
struct Logger2#
Defines a registerable callback interface to receive notification of every log message.
Public Functions
-
virtual void handleMessage(const LogMessage &message) = 0#
Called to notify of a log message.
This function is called by ILogging if
*this
has been registered via ILogging::addLogger(), the log level passes the threshold (for module or globally if not set for modules), and logging is enabled (for module or globally if not set for module).- Thread Safety
this function can be called simultaneously by multiple threads. The thread that calls this function is not necessarily the thread that emitted the log message, such as when asynchronous logging is enabled.
Note
The framework protects against recursively calling
*this
in the event thathandleMessage
causes a log message to be recursively emitted. In these situations,*this
will not receive the recursive log message, but otherLogger2
instances will receive it.Note
In some cases such as internal locks being held, log messages are deferred by the Framework in order to prevent
Logger2
instances from calling back into the Framework when unsafe operations could be performed.Warning
The
message
has asizeOf
parameter that must be checked to ensure safe access to fields.- Parameters:
message – The LogMessage structure containing information about the emitted log.
-
virtual void handleMessage(const LogMessage &message) = 0#