aboutsummaryrefslogtreecommitdiff
path: root/common/debug.h
diff options
context:
space:
mode:
authorEugene Sandulenko2016-08-19 09:38:25 +0200
committerEugene Sandulenko2016-08-19 09:55:22 +0200
commit0ab903a9e2416f329439d094bc6b6864a3454e37 (patch)
treeb68cad1e8c1c97cab404465b6a5fda22b12b8459 /common/debug.h
parent2074fad2cf48e901d3cacccad200d13e88487f82 (diff)
downloadscummvm-rg350-0ab903a9e2416f329439d094bc6b6864a3454e37.tar.gz
scummvm-rg350-0ab903a9e2416f329439d094bc6b6864a3454e37.tar.bz2
scummvm-rg350-0ab903a9e2416f329439d094bc6b6864a3454e37.zip
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
Diffstat (limited to 'common/debug.h')
-rw-r--r--common/debug.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/common/debug.h b/common/debug.h
index 00bad81fa6..883a0bf29d 100644
--- a/common/debug.h
+++ b/common/debug.h
@@ -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
@@ -111,6 +110,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
* debug output shall be generated, the higher the value, the more verbose the