Class: Slogger::Logger
Overview
The wrapper for standard Ruby Syslog library.
Sample:
slogger = Slogger::Logger.new “sample_app”, :info, :local0 slogger.info “A good info” slogger.debug “A deep info (oops! it’ll not be logged)”
Constant Summary collapse
- SEVERITIES =
Just sugars
::Slogger::Base::SYSLOG_SEVERITIES
- FACILITIES =
::Slogger::Base::SYSLOG_FACILITIES
Constants inherited from Base
Base::SYSLOG_FACILITIES, Base::SYSLOG_SEVERITIES
Instance Attribute Summary
Attributes inherited from Base
#app_name, #facility, #severity
Instance Method Summary collapse
-
#initialize(app_name, severity, facility) ⇒ Logger
constructor
To build a Slogger::Logger instance.
Methods inherited from Base
#log, #raise_argument_error_to_invalid_parameter, #raise_argument_error_to_required_parameter
Constructor Details
#initialize(app_name, severity, facility) ⇒ Logger
To build a Slogger::Logger instance.
app_name
-
The appliaction name to be logged
severity
-
The log severity: :emerg, :alert, :crit, :err, :warning, :notice,
:info, or :debug. It can be changed at anytime.
facility
-
A typical syslog facility: :kernel, :user, :mail, :daemon, :auth,
:syslog, :lpr, :news, :uucp, :cron, :authpriv, :ftp, :local0, :local1, :local2, :local3, :local4, :local5, :local6, or :local7
Raises an ArgumentError if app_name, severity, or facility is nil.
32 33 34 |
# File 'lib/slogger/logger.rb', line 32 def initialize(app_name, severity, facility) super app_name, severity, facility end |