Class: ActiveLogger::Formatters::Syslog::LevelMap

Inherits:
Object
  • Object
show all
Defined in:
lib/active_logger/formatters/syslog.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(debug: ::Syslog::LOG_DEBUG, info: ::Syslog::LOG_INFO, warn: ::Syslog::LOG_WARNING, error: ::Syslog::LOG_ERR, fatal: ::Syslog::LOG_CRIT) ⇒ LevelMap

Returns a new instance of LevelMap.



14
15
16
17
18
19
20
# File 'lib/active_logger/formatters/syslog.rb', line 14

def initialize(debug: ::Syslog::LOG_DEBUG, info: ::Syslog::LOG_INFO, warn: ::Syslog::LOG_WARNING, error: ::Syslog::LOG_ERR, fatal: ::Syslog::LOG_CRIT)
  @debug = debug
  @info  = info
  @warn  = warn
  @error = error
  @fatal = fatal
end

Instance Attribute Details

#debugObject

Returns the value of attribute debug.



12
13
14
# File 'lib/active_logger/formatters/syslog.rb', line 12

def debug
  @debug
end

#errorObject

Returns the value of attribute error.



12
13
14
# File 'lib/active_logger/formatters/syslog.rb', line 12

def error
  @error
end

#fatalObject

Returns the value of attribute fatal.



12
13
14
# File 'lib/active_logger/formatters/syslog.rb', line 12

def fatal
  @fatal
end

#infoObject

Returns the value of attribute info.



12
13
14
# File 'lib/active_logger/formatters/syslog.rb', line 12

def info
  @info
end

#traceObject

Returns the value of attribute trace.



12
13
14
# File 'lib/active_logger/formatters/syslog.rb', line 12

def trace
  @trace
end

#warnObject

Returns the value of attribute warn.



12
13
14
# File 'lib/active_logger/formatters/syslog.rb', line 12

def warn
  @warn
end

Instance Method Details

#[](level) ⇒ Object



22
23
24
# File 'lib/active_logger/formatters/syslog.rb', line 22

def [](level)
  public_send(level.to_s.downcase)
end