Add LOG_LEVEL_ACTIONS to log the applying actions
[privoxy.git] / errlog.c
index 1cd39a3..ddcc39b 100644 (file)
--- a/errlog.c
+++ b/errlog.c
@@ -1,4 +1,4 @@
-const char errlog_rcs[] = "$Id: errlog.c,v 1.112 2011/09/04 11:10:56 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;
@@ -666,7 +686,7 @@ void log_error(int loglevel, const char *fmt, ...)
 #ifndef _WIN32
       || (logfp == NULL)
 #endif
-     )
+      )
    {
       if (loglevel == LOG_LEVEL_FATAL)
       {
@@ -887,7 +907,7 @@ void log_error(int loglevel, const char *fmt, ...)
    if ((length >= log_buffer_size)
     || (outbuf[log_buffer_size-1] != '\0')
     || (outbuf[log_buffer_size] != '\0')
-     )
+      )
    {
       /* Repeat as assertions */
       assert(length < log_buffer_size);