added some stuff so we get debug messages in debug mode!
This commit is contained in:
parent
89617e48f3
commit
754b2fe924
2 changed files with 8 additions and 5 deletions
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
* USA
|
||||
*
|
||||
* $Id: s_debug.c,v 1.4 2002/09/13 06:50:08 fishwaldo Exp $
|
||||
* $Id: s_debug.c,v 1.5 2002/11/01 01:32:34 fishwaldo Exp $
|
||||
*/
|
||||
|
||||
#include "stdinc.h"
|
||||
|
@ -67,15 +67,18 @@ void debug(int level, char *format, ...)
|
|||
static char debugbuf[1024];
|
||||
va_list args;
|
||||
int err = errno;
|
||||
|
||||
#ifndef DEBUG
|
||||
if ((debuglevel >= 0) && (level <= debuglevel)) {
|
||||
#endif
|
||||
va_start(args, format);
|
||||
|
||||
vsprintf(debugbuf, format, args);
|
||||
va_end(args);
|
||||
|
||||
ilog(L_DEBUG, "%s", debugbuf);
|
||||
#ifndef DEBUG
|
||||
}
|
||||
#endif
|
||||
errno = err;
|
||||
} /* debug() */
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
* USA
|
||||
*
|
||||
* $Id: s_log.c,v 1.4 2002/09/19 05:41:11 fishwaldo Exp $
|
||||
* $Id: s_log.c,v 1.5 2002/11/01 01:32:37 fishwaldo Exp $
|
||||
*/
|
||||
|
||||
#include "stdinc.h"
|
||||
|
@ -122,10 +122,10 @@ ilog(int priority, const char* fmt, ...)
|
|||
assert(-1 < priority);
|
||||
if(fmt == NULL)
|
||||
return;
|
||||
|
||||
#ifndef DEBUG
|
||||
if (priority > logLevel)
|
||||
return;
|
||||
|
||||
#endif
|
||||
va_start(args, fmt);
|
||||
vsprintf(buf, fmt, args);
|
||||
va_end(args);
|
||||
|
|
Reference in a new issue