diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/debug-channels.h | 20 | ||||
-rw-r--r-- | common/debug.cpp | 10 |
2 files changed, 28 insertions, 2 deletions
diff --git a/common/debug-channels.h b/common/debug-channels.h index 0fb8006803..a2df35102f 100644 --- a/common/debug-channels.h +++ b/common/debug-channels.h @@ -80,7 +80,7 @@ public: void clearAllDebugChannels(); /** - * Enables an debug channel. + * Enables a debug channel. * * @param name the name of the debug channel to enable * @return true on success, false on failure @@ -88,13 +88,29 @@ public: bool enableDebugChannel(const String &name); /** - * Disables an debug channel. + * Enables a debug channel. + * + * @param channel The debug channel + * @return true on success, false on failure + */ + bool enableDebugChannel(uint32 channel); + + /** + * Disables a debug channel. * * @param name the name of the debug channel to disable * @return true on success, false on failure */ bool disableDebugChannel(const String &name); + /** + * Disables a debug channel. + * + * @param channel The debug channel + * @return true on success, false on failure + */ + bool disableDebugChannel(uint32 channel); + typedef List<DebugChannel> DebugChannelList; /** diff --git a/common/debug.cpp b/common/debug.cpp index 5db8990db8..568d2d52cb 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -78,6 +78,11 @@ bool DebugManager::enableDebugChannel(const String &name) { } } +bool DebugManager::enableDebugChannel(uint32 channel) { + gDebugChannelsEnabled |= channel; + return true; +} + bool DebugManager::disableDebugChannel(const String &name) { DebugChannelMap::iterator i = gDebugChannels.find(name); @@ -91,6 +96,11 @@ bool DebugManager::disableDebugChannel(const String &name) { } } +bool DebugManager::disableDebugChannel(uint32 channel) { + gDebugChannelsEnabled &= ~channel; + return true; +} + DebugManager::DebugChannelList DebugManager::listDebugChannels() { DebugChannelList tmp; for (DebugChannelMap::iterator i = gDebugChannels.begin(); i != gDebugChannels.end(); ++i) |