Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added documentation for generated logger methods

  • Loading branch information...
commit 4a0a5e14fd3471641d64b7431a0c3ce06022ec63 1 parent 2b2d9be
@drbrain drbrain authored
Showing with 48 additions and 1 deletion.
  1. +6 −0 History.txt
  2. +42 −1 lib/syslog_logger.rb
View
6 History.txt
@@ -1,3 +1,9 @@
+== 1.4.1
+
+* Bug fixes
+ * Messages for syslog() are no longer cleaned twice. Pull Request #3 by
+ Lourens Naudé
+
== 1.4.0 / 2007-05-08
* Split from rails_analyzer_tools.
View
43 lib/syslog_logger.rb
@@ -77,10 +77,15 @@ class SyslogLogger
##
# The version of SyslogLogger you are using.
- VERSION = '1.4.0'
+ VERSION = '1.4.1'
##
# Maps Logger warning types to syslog(3) warning types.
+ #
+ # Messages from ruby applications are not considered as critical as messages
+ # from other processes using syslog(3), so most messages are reduced by one
+ # level. For example, a fatal message for ruby's Logger is considered an
+ # error for syslog(3).
LOGGER_MAP = {
:unknown => :alert,
@@ -126,6 +131,42 @@ def #{meth}?
EOM
end
+ ##
+ # :method: unknown
+ #
+ # Logs a +message+ at the unknown (syslog alert) log level, or logs the
+ # message returned from the block.
+
+ ##
+ # :method: fatal
+ #
+ # Logs a +message+ at the fatal (syslog err) log level, or logs the message
+ # returned from the block.
+
+ ##
+ # :method: error
+ #
+ # Logs a +message+ at the error (syslog warning) log level, or logs the
+ # message returned from the block.
+
+ ##
+ # :method: warn
+ #
+ # Logs a +message+ at the warn (syslog notice) log level, or logs the
+ # message returned from the block.
+
+ ##
+ # :method: info
+ #
+ # Logs a +message+ at the info (syslog info) log level, or logs the message
+ # returned from the block.
+
+ ##
+ # :method: debug
+ #
+ # Logs a +message+ at the debug (syslog debug) log level, or logs the
+ # message returned from the block.
+
LOGGER_MAP.each_key do |level|
make_methods level
end
Please sign in to comment.
Something went wrong with that request. Please try again.