Module: sip-router Branch: ser_core_cvs Commit: 54dc33029c49da6f0ab28545c80a5aa99483ce42 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=54dc3302...
Author: Andrei Pelinescu-Onciul andrei@iptel.org Committer: Andrei Pelinescu-Onciul andrei@iptel.org Date: Thu May 7 11:50:41 2009 +0000
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).
---
dprint.c | 3 ++- dprint.h | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dprint.c b/dprint.c index ace2d78..aca97ba 100644 --- a/dprint.c +++ b/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 */ diff --git a/dprint.h b/dprint.h index 083bd2e..4865bdf 100644 --- a/dprint.h +++ b/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)