Infinity Engine v0.6.20
C++ API Documentation
Loading...
Searching...
No Matches
Infinity::Logging Namespace Reference

Typedefs

using logging_callback = void(*)(std::string_view)
 Function pointer type for logging callbacks.
 

Functions

void INFINITY_API_PUBLIC add_logging_callback (logging_callback callback)
 Registers a callback function to receive log messages.
 
void INFINITY_API_PUBLIC remove_logging_callback (logging_callback callback)
 Unregisters a previously registered logging callback.
 

Typedef Documentation

◆ logging_callback

Function pointer type for logging callbacks.

Defines the signature for callback functions that receive log messages from the Infinity Engine. Callbacks receive log messages as string views and can process them for display, file output, or forwarding to external logging systems.

Parameters
messageThe log message as a string_view.

Function Documentation

◆ add_logging_callback()

void INFINITY_API_PUBLIC Infinity::Logging::add_logging_callback ( logging_callback  callback)

Registers a callback function to receive log messages.

Adds a logging callback to the list of active callbacks. When the Infinity Engine generates log messages, all registered callbacks will be invoked with the message content. Multiple callbacks can be registered simultaneously.

Parameters
callbackFunction pointer to the logging callback to register.
Note
The callback should be thread-safe if the engine logs from multiple threads.
The same callback can only be registered once; duplicate registrations are ignored.

◆ remove_logging_callback()

void INFINITY_API_PUBLIC Infinity::Logging::remove_logging_callback ( logging_callback  callback)

Unregisters a previously registered logging callback.

Removes the specified callback from the list of active callbacks. After removal, the callback will no longer receive log messages from the Infinity Engine.

Parameters
callbackFunction pointer to the logging callback to unregister.
Note
If the callback was not previously registered, this function has no effect.