carb::logging::Logger

Defined in carb/logging/Logger.h

struct Logger

Defines an extension interface for logging backends to register with the ILogging system.

See also

ILogging::addLogger

See also

ILogging::removeLogger

Subclassed by carb::logging::StandardLogger

Public Members

void (*handleMessage)(Logger *logger, const char *source, int32_t level, const char *filename, const char *functionName, int lineNumber, const char *message)

Handler for a formatted log message.

This function is called by ILogging if the Logger has been registered via ILogging::addLogger(), log level passes the threshold (for module or globally if not set for module), and logging is enabled (for module or globally if not set for module).

Thread Safety

this function will potentially be called simultaneously from multiple threads. The thread that calls this function is not necessarily the thread that originated the log message, such as in the case of asynchronous logging.

Note

As of 161.0 the Framework protects against recursively calling a Logger in the event that a Logger performs an action that would recursively log. In these situations, the offending Logger will not receive the recursive log message, but other Loggers will receive it.

Note

In some cases such as when certain mutexes are locked, log messages are deferred by the Framework in order to prevent Logger objects from calling back into the Framework on the thread that has the mutex locked.

Param logger

The logger interface - can be nullptr if not used by handleMessage

Param source

The source of the message in UTF8 character encoding - commonly plugin name

Param level

The severity level of the message

Param filename

The file name where the message originated from.

Param functionName

The name of the function where the message originated from.

Param lineNumber

The line number where the message originated from

Param message

The formatted message in UTF8 character encoding