Bladeren bron

core: log L_CRIT fix

- don't add a "BUG" prefix to L_CRIT log messages (there are many
  L_CRIT messages that are not bugs, e.g. parse errors).
- added a new level L_BUG, special for BUG use (automatically adds
  a "BUG" prefix).
Andrei Pelinescu-Onciul 16 jaren geleden
bovenliggende
commit
54dc33029c
2 gewijzigde bestanden met toevoegingen van 6 en 4 verwijderingen
  1. 2 1
      dprint.c
  2. 4 3
      dprint.h

+ 2 - 1
dprint.c

@@ -63,7 +63,8 @@ static int int_fac[]={LOG_AUTH ,  LOG_CRON , LOG_DAEMON ,
 
 struct log_level_info log_level_info[] = {
 	{"ALERT", LOG_ALERT},	  /* L_ALERT */
-	{"BUG", LOG_CRIT},        /* L_CRIT */
+	{"BUG", LOG_CRIT},         /* L_BUG */
+	{"",    LOG_CRIT},         /* L_CRIT */
 	{"ERROR", LOG_ERR},       /* L_ERR */
 	{"WARNING", LOG_WARNING}, /* L_WARN */
 	{"NOTICE", LOG_NOTICE},   /* L_NOTICE */

+ 4 - 3
dprint.h

@@ -72,7 +72,8 @@
 /*
  * Log levels
  */
-#define L_ALERT		-3
+#define L_ALERT		-4
+#define L_BUG		-3
 #define L_CRIT  	-2
 #define L_ERR   	-1
 #define L_WARN   	0
@@ -230,7 +231,7 @@ int log_facility_fixup(void *handle, str *gname, str *name, void **val);
  */
 #ifdef __SUNPRO_C
 #	define ALERT(...)  LOG(L_ALERT,  __VA_ARGS__)
-#	define BUG(...)    LOG(L_CRIT,   __VA_ARGS__)
+#	define BUG(...)    LOG(L_BUG,   __VA_ARGS__)
 #	define ERR(...)    LOG(L_ERR,    __VA_ARGS__)
 #	define WARN(...)   LOG(L_WARN,   __VA_ARGS__)
 #	define NOTICE(...) LOG(L_NOTICE, __VA_ARGS__)
@@ -247,7 +248,7 @@ int log_facility_fixup(void *handle, str *gname, str *name, void **val);
 		
 #else
 #	define ALERT(fmt, args...)  LOG(L_ALERT,  fmt, ## args)
-#	define BUG(fmt, args...)    LOG(L_CRIT,   fmt, ## args)
+#	define BUG(fmt, args...)    LOG(L_BUG,   fmt, ## args)
 #	define ERR(fmt, args...)    LOG(L_ERR,    fmt, ## args)
 #	define WARN(fmt, args...)   LOG(L_WARN,   fmt, ## args)
 #	define NOTICE(fmt, args...) LOG(L_NOTICE, fmt, ## args)