aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorEugene Sandulenko2009-06-10 10:11:24 +0000
committerEugene Sandulenko2009-06-10 10:11:24 +0000
commitff72f8531cea80be7606e338dbdbd6413b298661 (patch)
treefe39f3a307fa154d5b77b331bdd4d956b605ddba /common
parentea0a2bcbbdc0406eec97e161572c69da4e80f61a (diff)
downloadscummvm-rg350-ff72f8531cea80be7606e338dbdbd6413b298661.tar.gz
scummvm-rg350-ff72f8531cea80be7606e338dbdbd6413b298661.tar.bz2
scummvm-rg350-ff72f8531cea80be7606e338dbdbd6413b298661.zip
Added debugCN() call which does not add newline automatically
svn-id: r41421
Diffstat (limited to 'common')
-rw-r--r--common/debug.cpp26
-rw-r--r--common/debug.h21
2 files changed, 47 insertions, 0 deletions
diff --git a/common/debug.cpp b/common/debug.cpp
index cc358596f7..ff17959cbf 100644
--- a/common/debug.cpp
+++ b/common/debug.cpp
@@ -227,6 +227,19 @@ void debugC(int level, uint32 debugChannels, const char *s, ...) {
va_end(va);
}
+void debugCN(int level, uint32 debugChannels, const char *s, ...) {
+ va_list va;
+
+ // Debug level 11 turns on all special debug level messages
+ if (gDebugLevel != 11)
+ if (level > gDebugLevel || !(Common::gDebugLevelsEnabled & debugChannels))
+ return;
+
+ va_start(va, s);
+ debugHelper(s, va, false);
+ va_end(va);
+}
+
void debugC(uint32 debugChannels, const char *s, ...) {
va_list va;
@@ -240,4 +253,17 @@ void debugC(uint32 debugChannels, const char *s, ...) {
va_end(va);
}
+void debugCN(uint32 debugChannels, const char *s, ...) {
+ va_list va;
+
+ // Debug level 11 turns on all special debug level messages
+ if (gDebugLevel != 11)
+ if (!(Common::gDebugLevelsEnabled & debugChannels))
+ return;
+
+ va_start(va, s);
+ debugHelper(s, va, false);
+ va_end(va);
+}
+
#endif
diff --git a/common/debug.h b/common/debug.h
index 43fe297859..888c71adbb 100644
--- a/common/debug.h
+++ b/common/debug.h
@@ -106,6 +106,8 @@ inline void debug(int level, const char *s, ...) {}
inline void debugN(int level, const char *s, ...) {}
inline void debugC(int level, uint32 engine_level, const char *s, ...) {}
inline void debugC(uint32 engine_level, const char *s, ...) {}
+inline void debugCN(int level, uint32 engine_level, const char *s, ...) {}
+inline void debugCN(uint32 engine_level, const char *s, ...) {}
#else
@@ -146,6 +148,17 @@ void debugC(int level, uint32 debugChannels, const char *s, ...) GCC_PRINTF(3, 4
/**
* Print a debug message to the text console (stdout), but only if
+ * the specified level does not exceed the value of gDebugLevel OR
+ * 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 enableDebugChannel
+ */
+void debugCN(int level, uint32 debugChannels, const char *s, ...) GCC_PRINTF(3, 4);
+
+/**
+ * Print a debug message to the text console (stdout), but only if
* the specified special debug level is active.
* Automatically appends a newline.
*
@@ -153,6 +166,14 @@ void debugC(int level, uint32 debugChannels, const char *s, ...) GCC_PRINTF(3, 4
*/
void debugC(uint32 debugChannels, const char *s, ...) GCC_PRINTF(2, 3);
+/**
+ * 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 enableDebugChannel
+ */
+void debugCN(uint32 debugChannels, const char *s, ...) GCC_PRINTF(2, 3);
#endif