From 0c1d6cde4097235e88daf591f5f592a229e1cf0b Mon Sep 17 00:00:00 2001 From: Chris Powell Date: Sat, 1 Nov 2008 00:01:40 -0700 Subject: [PATCH] Remapped the Rails-side levels to more appropriate Syslog-side levels -- they now match in a more intuitive way. --- lib/syslog_logger.rb | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/lib/syslog_logger.rb b/lib/syslog_logger.rb index 49c1fb1..3da3053 100644 --- a/lib/syslog_logger.rb +++ b/lib/syslog_logger.rb @@ -8,16 +8,33 @@ class SyslogLogger VERSION = '1.4.1' + # From 'man syslog.h': + # LOG_EMERG A panic condition was reported to all processes. + # LOG_ALERT A condition that should be corrected immediately. + # LOG_CRIT A critical condition. + # LOG_ERR An error message. + # LOG_WARNING A warning message. + # LOG_NOTICE A condition requiring special handling. + # LOG_INFO A general information message. + # LOG_DEBUG A message useful for debugging programs. + + # From logger rdoc: + # FATAL: an unhandleable error that results in a program crash + # ERROR: a handleable error condition + # WARN: a warning + # INFO: generic (useful) information about system operation + # DEBUG: low-level information for developers + ## # Maps Logger warning types to syslog(3) warning types. LOGGER_MAP = { :unknown => :alert, - :fatal => :err, - :error => :warning, - :warn => :notice, + :fatal => :alert, + :error => :err, + :warn => :warning, :info => :info, - :debug => :debug, + :debug => :debug } ##