X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=errlog.c;h=ddcc39b2b44c60cadb4538d1a7408972fb447b5e;hp=5658735286a6f4b85585ad3bc87954a3b41c0aaa;hb=a8214172984f66ffd964e1e749ca2682dd958947;hpb=0428133610c525457cb16f7ac6a54203a2743d6c diff --git a/errlog.c b/errlog.c index 56587352..ddcc39b2 100644 --- a/errlog.c +++ b/errlog.c @@ -1,4 +1,4 @@ -const char errlog_rcs[] = "$Id: errlog.c,v 1.111 2011/06/25 12:39:18 fabiankeil Exp $"; +const char errlog_rcs[] = "$Id: errlog.c,v 1.115 2012/07/27 17:27:47 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/errlog.c,v $ @@ -244,6 +244,23 @@ void set_debug_level(int debug_level) } +/********************************************************************* + * + * Function : debug_level_is_enabled + * + * Description : Checks if a certain debug level is enabled. + * + * Parameters : 1: debug_level = The debug level to check. + * + * Returns : Nothing. + * + *********************************************************************/ +int debug_level_is_enabled(int debug_level) +{ + return (0 != (debug & debug_level)); +} + + /********************************************************************* * * Function : disable_logging @@ -604,6 +621,9 @@ static inline const char *get_log_level_string(int loglevel) case LOG_LEVEL_CGI: log_level_string = "CGI"; break; + case LOG_LEVEL_ACTIONS: + log_level_string = "Actions"; + break; default: log_level_string = "Unknown log level"; break; @@ -743,11 +763,11 @@ void log_error(int loglevel, const char *fmt, ...) tempbuf[1] = '\0'; break; case 'd': - ival = va_arg( ap, int ); + ival = va_arg(ap, int); snprintf(tempbuf, sizeof(tempbuf), "%d", ival); break; case 'u': - uval = va_arg( ap, unsigned ); + uval = va_arg(ap, unsigned); snprintf(tempbuf, sizeof(tempbuf), "%u", uval); break; case 'l': @@ -755,12 +775,12 @@ void log_error(int loglevel, const char *fmt, ...) ch = *src++; if (ch == 'd') { - lval = va_arg( ap, long ); + lval = va_arg(ap, long); snprintf(tempbuf, sizeof(tempbuf), "%ld", lval); } else if (ch == 'u') { - ulval = va_arg( ap, unsigned long ); + ulval = va_arg(ap, unsigned long); snprintf(tempbuf, sizeof(tempbuf), "%lu", ulval); } else if ((ch == 'l') && (*src == 'u'))