Root/
Source at commit 1322 created 12 years 7 months ago. By meklort, Add doxygen to utils folder | |
---|---|
1 | #include <stdio.h>␊ |
2 | #include <stdlib.h>␊ |
3 | #include <stdarg.h>␊ |
4 | ␊ |
5 | #include "debug.h"␊ |
6 | ␊ |
7 | static int s_debugLevel = 0;␊ |
8 | ␊ |
9 | void debug(int level,const char *msg,...)␊ |
10 | {␊ |
11 | if (level<=s_debugLevel)␊ |
12 | {␊ |
13 | va_list args;␊ |
14 | va_start(args, msg);␊ |
15 | vfprintf(stderr, msg, args);␊ |
16 | va_end(args); ␊ |
17 | }␊ |
18 | }␊ |
19 | ␊ |
20 | void setDebugLevel(int level)␊ |
21 | {␊ |
22 | s_debugLevel = level;␊ |
23 | }␊ |
24 | ␊ |
25 |