ScummVM API documentation
Common::DebugManager Class Reference
Inheritance diagram for Common::DebugManager:
Common::Singleton< DebugManager > Common::NonCopyable

Classes

struct  DebugChannel
 

Public Types

typedef List< DebugChannelDebugChannelList
 

Public Member Functions

bool addDebugChannel (uint32 channel, const String &name, const String &description)
 
void addAllDebugChannels (const DebugChannelDef *channels)
 
void removeAllDebugChannels ()
 
bool enableDebugChannel (const String &name)
 
bool enableDebugChannel (uint32 channel)
 
bool disableDebugChannel (const String &name)
 
bool disableDebugChannel (uint32 channel)
 
DebugChannelList getDebugChannels ()
 
void enableAllDebugChannels ()
 
void disableAllDebugChannels ()
 
bool isDebugChannelEnabled (uint32 channel, bool enforce=false)
 

Additional Inherited Members

- Static Public Member Functions inherited from Common::Singleton< DebugManager >
static bool hasInstance ()
 
static DebugManagerinstance ()
 
static void destroy ()
 
- Protected Types inherited from Common::Singleton< DebugManager >
typedef DebugManager SingletonBaseType
 
- Static Protected Attributes inherited from Common::Singleton< DebugManager >
static DebugManager_singleton
 

Member Function Documentation

◆ addDebugChannel()

bool Common::DebugManager::addDebugChannel ( uint32  channel,
const String name,
const String description 
)

Add a debug channel.

A debug channel is considered roughly similar to what the debug levels described by gDebugLevel try to achieve:

Debug channels should only affect the display of additional debug output, based on their state. That is, if they are enabled, channel-specific debug messages should be shown. If they are disabled on the other hand, those messages will be hidden.

See also
gDebugLevel

Note that we have debug* functions that depend both on the debug level set and specific debug channels. Those functions will only show output, when both criteria are satisfied.

Parameters
channelChannel ID.
nameThe option name that is used in the debugger/on the command line to enable this special debug level (case will be ignored).
descriptionThe description that shows up in the debugger.
Returns
True on success, false on failure.

◆ addAllDebugChannels()

void Common::DebugManager::addAllDebugChannels ( const DebugChannelDef channels)

Add all the debug channels for an engine. This replaces any existing engine debug channels and disables all channels.

◆ removeAllDebugChannels()

void Common::DebugManager::removeAllDebugChannels ( )

Remove all engine debug channels and disable all global debug channels.

◆ enableDebugChannel() [1/2]

bool Common::DebugManager::enableDebugChannel ( const String name)

Enable a debug channel.

Parameters
nameName of the debug channel to enable.
Returns
True on success, false on failure.

◆ enableDebugChannel() [2/2]

Common::DebugManager::enableDebugChannel ( uint32  channel)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
channelDebug channel.
Returns
True on success, false on failure.

◆ disableDebugChannel() [1/2]

bool Common::DebugManager::disableDebugChannel ( const String name)

Disable a debug channel.

Parameters
nameName of the debug channel to disable.
Returns
True on success, false on failure.

◆ disableDebugChannel() [2/2]

bool Common::DebugManager::disableDebugChannel ( uint32  channel)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
channelThe debug channel ID
Returns
true on success, false on failure

◆ getDebugChannels()

DebugChannelList Common::DebugManager::getDebugChannels ( )

Lists all debug channels. This includes engine and global debug channels.

Returns
List of all debug channels sorted by debug level.

◆ enableAllDebugChannels()

void Common::DebugManager::enableAllDebugChannels ( )

Enable all debug channels.

◆ disableAllDebugChannels()

void Common::DebugManager::disableAllDebugChannels ( )

Disable all debug channels.

◆ isDebugChannelEnabled()

bool Common::DebugManager::isDebugChannelEnabled ( uint32  channel,
bool  enforce = false 
)

Test whether the given debug channel is enabled.


The documentation for this class was generated from the following file: