bufr_print();
}
+bool dbgsetclass(int level, int cls)
+{
+ /* Set current_msg_level. */
+ current_msg_level = level;
+
+ /* Set current message class */
+ current_msg_class = cls;
+
+ return true;
+}
+
/***************************************************************************
Print a Debug Header.
return( true );
}
- /* Set current_msg_level. */
- current_msg_level = level;
-
- /* Set current message class */
- current_msg_class = cls;
+ dbgsetclass(level, cls);
/* Don't print a header if we're logging to stdout. */
if ( state.logtype != DEBUG_FILE ) {
bool dbgtext_va(const char *, va_list ap) PRINTF_ATTRIBUTE(1,0);
bool dbgtext( const char *, ... ) PRINTF_ATTRIBUTE(1,2);
bool dbghdrclass( int level, int cls, const char *location, const char *func);
+bool dbgsetclass(int level, int cls);
/*
* Define all new debug classes here. A class is represented by an entry in
#define DEBUGADD( level, body ) \
(void)( ((level) <= MAX_DEBUG_LEVEL) && \
- unlikely(debuglevel_get_class(DBGC_CLASS) >= (level)) \
+ unlikely(debuglevel_get_class(DBGC_CLASS) >= (level)) \
+ && (dbgsetclass(level, DBGC_CLASS)) \
&& (dbgtext body) )
#define DEBUGADDC( dbgc_class, level, body ) \
(void)( ((level) <= MAX_DEBUG_LEVEL) && \
- unlikely((debuglevel_get_class(dbgc_class) >= (level))) \
+ unlikely((debuglevel_get_class(dbgc_class) >= (level))) \
+ && (dbgsetclass(level, dbgc_class)) \
&& (dbgtext body) )
/* Print a separator to the debug log. */