diff options
Diffstat (limited to 'common/debug.c')
-rw-r--r-- | common/debug.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/common/debug.c b/common/debug.c index c4d3897..82e3c2f 100644 --- a/common/debug.c +++ b/common/debug.c @@ -39,6 +39,13 @@ #include "asprintf.h" #endif +static int debug_level; + +void internal_set_debug_level(int level) +{ + debug_level = level; +} + #define MAX_PRINT_LEN 16*1024 #ifndef STRIP_DEBUG_CODE @@ -77,7 +84,7 @@ void debug_info_real(const char *func, const char *file, int line, const char *f va_list args; char *buffer = NULL; - if (!idevice_debug_level) + if (!debug_level) return; /* run the real fprintf */ @@ -98,7 +105,7 @@ void debug_buffer(const char *data, const int length) int j; unsigned char c; - if (idevice_debug_level) { + if (debug_level) { for (i = 0; i < length; i += 16) { fprintf(stderr, "%04x: ", i); for (j = 0; j < 16; j++) { @@ -129,7 +136,7 @@ void debug_buffer(const char *data, const int length) void debug_buffer_to_file(const char *file, const char *data, const int length) { #ifndef STRIP_DEBUG_CODE - if (idevice_debug_level) { + if (debug_level) { FILE *f = fopen(file, "wb"); fwrite(data, 1, length, f); fflush(f); |