Skip to content

Commit

Permalink
Remapped the Rails-side levels to more appropriate Syslog-side levels…
Browse files Browse the repository at this point in the history
… -- they now match in a more intuitive way.
  • Loading branch information
cpowell committed Nov 1, 2008
1 parent 0953e2b commit 0c1d6cd
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions lib/syslog_logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

##
Expand Down

0 comments on commit 0c1d6cd

Please sign in to comment.