Debug Class Reference

Description

Utility class providing various debug functionality.

Note
Thread safe.

Methods

void logDebug (const String &msg)
 Adds a log entry in the "Debug" channel. More...
 
void logWarning (const String &msg)
 Adds a log entry in the "Warning" channel. More...
 
void logError (const String &msg)
 Adds a log entry in the "Error" channel. More...
 
void log (const String &msg, UINT32 channel)
 Adds a log entry in the specified channel. More...
 
LoggetLog ()
 Retrieves the Log used by the Debug instance. More...
 
void writeAsBMP (UINT8 *rawPixels, UINT32 bytesPerPixel, UINT32 width, UINT32 height, const Path &filePath, bool overwrite=true) const
 Converts raw pixels into a BMP image and saves it as a file.
 
void saveLog (const Path &path) const
 Saves a log about the current state of the application to the specified location. More...
 
Internal
void _triggerCallbacks ()
 Triggers callbacks that notify external code that a log entry was added. More...
 

Fields

Event< void(const LogEntry &)> onLogEntryAdded
 Triggered when a new entry in the log is added. More...
 
Event< void()> onLogModified
 Triggered whenever one or multiple log entries were added or removed. More...
 

Method documentation

void _triggerCallbacks ( )

Triggers callbacks that notify external code that a log entry was added.

Note
Sim thread only.
Log& getLog ( )

Retrieves the Log used by the Debug instance.

void log ( const String msg,
UINT32  channel 
)

Adds a log entry in the specified channel.

You may specify custom channels as needed.

void logDebug ( const String msg)

Adds a log entry in the "Debug" channel.

void logError ( const String msg)

Adds a log entry in the "Error" channel.

void logWarning ( const String msg)

Adds a log entry in the "Warning" channel.

void saveLog ( const Path path) const

Saves a log about the current state of the application to the specified location.

Parameters
pathAbsolute path to the log filename.

Member Data Documentation

Event<void(const LogEntry&)> onLogEntryAdded

Triggered when a new entry in the log is added.

Note
Sim thread only.
Event<void()> onLogModified

Triggered whenever one or multiple log entries were added or removed.

Triggers only once per frame.

Note
Sim thread only.