diff --git a/src/util.cpp b/src/util.cpp new file mode 100644 index 0000000..e9e5943 --- /dev/null +++ b/src/util.cpp @@ -0,0 +1,19 @@ +#include "util.h" + +static int debug_level = 0; + +void dbg_setlevel(int Level) +{ + debug_level=Level; +} + +void dbg_printf(int Level, const char *fmt, ...) +{ + if (Level <= debug_level) + { + va_list args; + va_start(args, fmt); + vfprintf(stderr, fmt, args); + va_end(args); + } +}