Class: SemanticLogger::Formatters::Syslog::LevelMap
- Inherits:
-
Object
- Object
- SemanticLogger::Formatters::Syslog::LevelMap
- Defined in:
- lib/semantic_logger/formatters/syslog.rb
Overview
Default level map for every log level
:fatal => ::Syslog::LOG_CRIT - “A critical condition has occurred” :error => ::Syslog::LOG_ERR - “An error occurred” :warning =>::Syslog::LOG_WARNING - “Warning of a possible problem” :info => ::Syslog::LOG_NOTICE - “A normal but significant condition occurred” :debug => ::Syslog::LOG_INFO - “Informational message” :trace => ::Syslog::LOG_DEBUG - “Debugging information”
The following levels are not used by default. ::Syslog::LOG_EMERG - “System is unusable” ::Syslog::LOG_ALERT - “Action needs to be taken immediately”
Instance Attribute Summary collapse
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#error ⇒ Object
Returns the value of attribute error.
-
#fatal ⇒ Object
Returns the value of attribute fatal.
-
#info ⇒ Object
Returns the value of attribute info.
-
#trace ⇒ Object
Returns the value of attribute trace.
-
#warn ⇒ Object
Returns the value of attribute warn.
Instance Method Summary collapse
- #[](level) ⇒ Object
-
#initialize(trace: ::Syslog::LOG_DEBUG, debug: ::Syslog::LOG_INFO, info: ::Syslog::LOG_NOTICE, warn: ::Syslog::LOG_WARNING, error: ::Syslog::LOG_ERR, fatal: ::Syslog::LOG_CRIT) ⇒ LevelMap
constructor
A new instance of LevelMap.
Constructor Details
#initialize(trace: ::Syslog::LOG_DEBUG, debug: ::Syslog::LOG_INFO, info: ::Syslog::LOG_NOTICE, warn: ::Syslog::LOG_WARNING, error: ::Syslog::LOG_ERR, fatal: ::Syslog::LOG_CRIT) ⇒ LevelMap
28 29 30 31 32 33 34 35 |
# File 'lib/semantic_logger/formatters/syslog.rb', line 28 def initialize(trace: ::Syslog::LOG_DEBUG, debug: ::Syslog::LOG_INFO, info: ::Syslog::LOG_NOTICE, warn: ::Syslog::LOG_WARNING, error: ::Syslog::LOG_ERR, fatal: ::Syslog::LOG_CRIT) @trace = trace @debug = debug @info = info @warn = warn @error = error @fatal = fatal end |
Instance Attribute Details
#debug ⇒ Object
Returns the value of attribute debug.
26 27 28 |
# File 'lib/semantic_logger/formatters/syslog.rb', line 26 def debug @debug end |
#error ⇒ Object
Returns the value of attribute error.
26 27 28 |
# File 'lib/semantic_logger/formatters/syslog.rb', line 26 def error @error end |
#fatal ⇒ Object
Returns the value of attribute fatal.
26 27 28 |
# File 'lib/semantic_logger/formatters/syslog.rb', line 26 def fatal @fatal end |
#info ⇒ Object
Returns the value of attribute info.
26 27 28 |
# File 'lib/semantic_logger/formatters/syslog.rb', line 26 def info @info end |
#trace ⇒ Object
Returns the value of attribute trace.
26 27 28 |
# File 'lib/semantic_logger/formatters/syslog.rb', line 26 def trace @trace end |
#warn ⇒ Object
Returns the value of attribute warn.
26 27 28 |
# File 'lib/semantic_logger/formatters/syslog.rb', line 26 def warn @warn end |
Instance Method Details
#[](level) ⇒ Object
37 38 39 |
# File 'lib/semantic_logger/formatters/syslog.rb', line 37 def [](level) public_send(level) end |