X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=blobdiff_plain;f=lib%2Fsilcutil%2Fsilclog.c;h=0ffb369432c31a890c9a75dc6b15e61aad114776;hp=3d3fc84b22a22653829930494915f00c25c53df4;hb=395df2c1aeed253ccaad7978a0cf866c3ef3a738;hpb=9d2081a0cdedd7e20f0fa4879a1de21a5c24e7bf diff --git a/lib/silcutil/silclog.c b/lib/silcutil/silclog.c index 3d3fc84b..0ffb3694 100644 --- a/lib/silcutil/silclog.c +++ b/lib/silcutil/silclog.c @@ -22,7 +22,8 @@ #include "silcincludes.h" /* Set TRUE/FALSE to enable/disable debugging */ -int silc_debug = FALSE; +bool silc_debug = FALSE; +bool silc_debug_hexdump = FALSE; char *silc_debug_string = NULL; /* SILC Log name strings. These strings are printed to the log file. */ @@ -178,7 +179,7 @@ void silc_log_output_hexdump(char *file, char *function, int off, pos, count; unsigned char *data = (unsigned char *)data_in; - if (!silc_debug) { + if (!silc_debug_hexdump) { silc_free(string); return; } @@ -315,5 +316,9 @@ void silc_log_reset_debug_callbacks() void silc_log_set_debug_string(const char *debug_string) { silc_free(silc_debug_string); - silc_debug_string = silc_string_regexify(debug_string); + if (strchr(debug_string, '(') && + strchr(debug_string, ')')) + silc_debug_string = strdup(debug_string); + else + silc_debug_string = silc_string_regexify(debug_string); }