ScummVM API documentation
Debug functions

Description

Functions for printing debug messages.

Enumerations

enum  GlobalDebugLevels { kDebugGlobalDetection = 100000, kDebugLevelEventRec, kDebugLevelMainGUI, kDebugLevelMacGUI }
 

Functions

void debug (MSVC_PRINTF const char *s,...) GCC_PRINTF(1
 
void void debug (int level, MSVC_PRINTF const char *s,...) GCC_PRINTF(2
 
void void void debugN (MSVC_PRINTF const char *s,...) GCC_PRINTF(1
 
void void void void debugN (int level, MSVC_PRINTF const char *s,...) GCC_PRINTF(2
 
void void void void void debugC (int level, uint32 debugChannels, MSVC_PRINTF const char *s,...) GCC_PRINTF(3
 
void void void void void void debugCN (int level, uint32 debugChannels, MSVC_PRINTF const char *s,...) GCC_PRINTF(3
 
void void void void void void void debugC (uint32 debugChannels, MSVC_PRINTF const char *s,...) GCC_PRINTF(2
 
void void void void void void void void debugCN (uint32 debugChannels, MSVC_PRINTF const char *s,...) GCC_PRINTF(2
 
void void void void void void void void bool debugLevelSet (int level)
 
bool debugChannelSet (int level, uint32 debugChannels)
 

Variables

int gDebugLevel
 
bool gDebugChannelsOnly
 

Enumeration Type Documentation

◆ GlobalDebugLevels

Global constant for EventRecorder debug channel.

Function Documentation

◆ debug() [1/2]

void debug ( MSVC_PRINTF const char *  s,
  ... 
)

Print a debug message to the text console (stdout). Automatically appends a newline.

◆ debug() [2/2]

void void debug ( int  level,
MSVC_PRINTF const char *  s,
  ... 
)

Print a debug message to the text console (stdout), but only if the gDebugLevel equals at least the specified level. As a rule of thumb, the more important the message, the lower the level. Automatically appends a newline.

◆ debugN() [1/2]

void void void debugN ( MSVC_PRINTF const char *  s,
  ... 
)

Print a debug message to the text console (stdout). Does not append a newline.

◆ debugN() [2/2]

void void void void debugN ( int  level,
MSVC_PRINTF const char *  s,
  ... 
)

Print a debug message to the text console (stdout), but only if the gDebugLevel equals at least the specified level. As a rule of thumb, the more important the message, the lower the level. Does not append a newline.

◆ debugC() [1/2]

void void void void void debugC ( int  level,
uint32  debugChannels,
MSVC_PRINTF const char *  s,
  ... 
)

Print a debug message to the text console (stdout), but only if the gDebugLevel equals at least the specified level AND if the specified special debug level is active. As a rule of thumb, the more important the message, the lower the level. Automatically appends a newline.

See also
enableDebugChannel
Parameters
levelDebug level that must be active for the message to be printed.
debugChannelsBitfield of channels to check against.
sMessage to print.

◆ debugCN() [1/2]

void void void void void void debugCN ( int  level,
uint32  debugChannels,
MSVC_PRINTF const char *  s,
  ... 
)

Print a debug message to the text console (stdout), but only if the gDebugLevel equals at least the specified level AND if the specified special debug level is active. As a rule of thumb, the more important the message, the lower the level. Does not append a newline automatically.

See also
enableDebugChannel
Parameters
levelDebug level that must be active for the message to be printed.
debugChannelsBitfield of channels to check against.
sMessage to print.

◆ debugC() [2/2]

void void void void void void void debugC ( uint32  debugChannels,
MSVC_PRINTF const char *  s,
  ... 
)

Print a debug message to the text console (stdout), but only if the specified special debug level is active. Automatically appends a newline.

See also
enableDebugChannel
Parameters
debugChannelsBitfield of channels to check against.
sMessage to print.

◆ debugCN() [2/2]

void void void void void void void void debugCN ( uint32  debugChannels,
MSVC_PRINTF const char *  s,
  ... 
)

Print a debug message to the text console (stdout), but only if the specified special debug level is active. Does not append a newline automatically.

See also
enableDebugChannel
Parameters
debugChannelsBitfield of channels to check against.
sMessage to print.

◆ debugLevelSet()

void void void void void void void void bool debugLevelSet ( int  level)

Check whether the debug level is set to the specified level.

◆ debugChannelSet()

bool debugChannelSet ( int  level,
uint32  debugChannels 
)

Check whether the debug level and channel are active.

Parameters
levelDebug level to check against. If set to -1, only channel check is active.
debugChannelsBitfield of channels to check against.
See also
enableDebugChannel

Variable Documentation

◆ gDebugLevel

int gDebugLevel

The debug level. Initially set to -1, indicating that no debug output should be shown. Positive values usually imply that an increasing number of debug output shall be generated. The higher the value, the more verbose the information (although the exact semantics are up to the engines).

◆ gDebugChannelsOnly

bool gDebugChannelsOnly

Specify whether to show only the debug channels and suppress the non-channeled output.

This option is useful when you want to have higher levels of channels visible without the noise from other subsystems or OSystem.