Browse code

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 authored on 07/05/2009 11:50:41
Showing 2 changed files
... ...
@@ -63,7 +63,8 @@ static int int_fac[]={LOG_AUTH ,  LOG_CRON , LOG_DAEMON ,
63 63
 
64 64
 struct log_level_info log_level_info[] = {
65 65
 	{"ALERT", LOG_ALERT},	  /* L_ALERT */
66
-	{"BUG", LOG_CRIT},        /* L_CRIT */
66
+	{"BUG", LOG_CRIT},         /* L_BUG */
67
+	{"",    LOG_CRIT},         /* L_CRIT */
67 68
 	{"ERROR", LOG_ERR},       /* L_ERR */
68 69
 	{"WARNING", LOG_WARNING}, /* L_WARN */
69 70
 	{"NOTICE", LOG_NOTICE},   /* L_NOTICE */
... ...
@@ -72,7 +72,8 @@
72 72
 /*
73 73
  * Log levels
74 74
  */
75
-#define L_ALERT		-3
75
+#define L_ALERT		-4
76
+#define L_BUG		-3
76 77
 #define L_CRIT  	-2
77 78
 #define L_ERR   	-1
78 79
 #define L_WARN   	0
... ...
@@ -230,7 +231,7 @@ int log_facility_fixup(void *handle, str *gname, str *name, void **val);
230 230
  */
231 231
 #ifdef __SUNPRO_C
232 232
 #	define ALERT(...)  LOG(L_ALERT,  __VA_ARGS__)
233
-#	define BUG(...)    LOG(L_CRIT,   __VA_ARGS__)
233
+#	define BUG(...)    LOG(L_BUG,   __VA_ARGS__)
234 234
 #	define ERR(...)    LOG(L_ERR,    __VA_ARGS__)
235 235
 #	define WARN(...)   LOG(L_WARN,   __VA_ARGS__)
236 236
 #	define NOTICE(...) LOG(L_NOTICE, __VA_ARGS__)
... ...
@@ -247,7 +248,7 @@ int log_facility_fixup(void *handle, str *gname, str *name, void **val);
247 247
 		
248 248
 #else
249 249
 #	define ALERT(fmt, args...)  LOG(L_ALERT,  fmt, ## args)
250
-#	define BUG(fmt, args...)    LOG(L_CRIT,   fmt, ## args)
250
+#	define BUG(fmt, args...)    LOG(L_BUG,   fmt, ## args)
251 251
 #	define ERR(fmt, args...)    LOG(L_ERR,    fmt, ## args)
252 252
 #	define WARN(fmt, args...)   LOG(L_WARN,   fmt, ## args)
253 253
 #	define NOTICE(fmt, args...) LOG(L_NOTICE, fmt, ## args)