blob: a8be32c196d7b11dd1ed7e824179516587d61b3a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include "debug.h"
static int s_debugLevel = 0;
void debug(int level,const char *msg,...)
{
if (level<=s_debugLevel)
{
va_list args;
va_start(args, msg);
vfprintf(stderr, msg, args);
va_end(args);
}
}
void setDebugLevel(int level)
{
s_debugLevel = level;
}
|