mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-20 19:21:46 +00:00
COMMON: Added checkers for debug channels.
Sometimes there is a need to add debug execution and enable it from the command line. Now it is possible, both with debug levels and channels
This commit is contained in:
parent
2074fad2cf
commit
0ab903a9e2
@ -120,6 +120,18 @@ bool DebugManager::isDebugChannelEnabled(uint32 channel) {
|
||||
|
||||
} // End of namespace Common
|
||||
|
||||
bool debugLevelSet(int level) {
|
||||
return level <= gDebugLevel;
|
||||
}
|
||||
|
||||
bool debugChannelSet(int level, uint32 debugChannels) {
|
||||
if (gDebugLevel != 11)
|
||||
if (level > gDebugLevel || !(DebugMan.isDebugChannelEnabled(debugChannels)))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
#ifndef DISABLE_TEXT_CONSOLE
|
||||
|
||||
|
@ -31,11 +31,10 @@ inline void debug(const char *s, ...) {}
|
||||
inline void debug(int level, const char *s, ...) {}
|
||||
inline void debugN(const char *s, ...) {}
|
||||
inline void debugN(int level, const char *s, ...) {}
|
||||
inline void debugC(int level, uint32 engineChannel, const char *s, ...) {}
|
||||
inline void debugC(uint32 engineChannel, const char *s, ...) {}
|
||||
inline void debugCN(int level, uint32 engineChannel, const char *s, ...) {}
|
||||
inline void debugCN(uint32 engineChannel, const char *s, ...) {}
|
||||
|
||||
inline void debugC(int level, uint32 debugChannels, const char *s, ...) {}
|
||||
inline void debugC(uint32 debugChannels, const char *s, ...) {}
|
||||
inline void debugCN(int level, uint32 debugChannels, const char *s, ...) {}
|
||||
inline void debugCN(uint32 debugChannels, const char *s, ...) {}
|
||||
|
||||
#else
|
||||
|
||||
@ -110,6 +109,18 @@ void debugCN(uint32 debugChannels, const char *s, ...) GCC_PRINTF(2, 3);
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Returns true if the debug level is set to the specified level
|
||||
*/
|
||||
bool debugLevelSet(int level);
|
||||
|
||||
/**
|
||||
* Returns true if the debug level and channel are active
|
||||
*
|
||||
* @see enableDebugChannel
|
||||
*/
|
||||
bool debugChannelSet(int level, uint32 debugChannels);
|
||||
|
||||
/**
|
||||
* The debug level. Initially set to -1, indicating that no debug output
|
||||
* should be shown. Positive values usually imply an increasing number of
|
||||
|
Loading…
x
Reference in New Issue
Block a user