Added debugCN() call which does not add newline automatically

svn-id: r41421
This commit is contained in:
Eugene Sandulenko 2009-06-10 10:11:24 +00:00
parent ea0a2bcbbd
commit ff72f8531c
2 changed files with 47 additions and 0 deletions

View File

@ -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

View File

@ -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
@ -144,6 +146,17 @@ void debugN(int level, const char *s, ...) GCC_PRINTF(2, 3);
*/
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.
@ -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