diff options
Diffstat (limited to 'addon/doxmlparser/src/debug.cpp')
-rw-r--r-- | addon/doxmlparser/src/debug.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/addon/doxmlparser/src/debug.cpp b/addon/doxmlparser/src/debug.cpp new file mode 100644 index 0000000..a8be32c --- /dev/null +++ b/addon/doxmlparser/src/debug.cpp @@ -0,0 +1,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; +} + |