scyther/src/debug.c

31 lines
391 B
C
Raw Normal View History

2004-04-23 11:58:43 +01:00
#include <stdio.h>
#include <stdlib.h>
#include "debug.h"
#include "runs.h"
static int debuglevel;
void
debugSet (int level)
{
debuglevel = level;
}
int
debugCond (int level)
{
return (level <= debuglevel);
}
void
debug (int level, char *string)
{
#ifdef DEBUG
if (debugCond (level))
{
indent ();
2004-05-12 15:07:56 +01:00
fprintf (stderr, "DEBUG [%i]: %s\n", level, string);
2004-04-23 11:58:43 +01:00
}
#endif
}