Class: SemanticLogger::Appender::Graylog::LevelMap

Inherits:
Object
  • Object
show all
Defined in:
lib/semantic_logger/appender/graylog.rb

Overview

Map Semantic Logger levels to Graylog levels

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(trace: GELF::DEBUG, debug: GELF::DEBUG, info: GELF::INFO, warn: GELF::WARN, error: GELF::ERROR, fatal: GELF::FATAL) ⇒ LevelMap

Returns a new instance of LevelMap.



28
29
30
31
32
33
34
35
# File 'lib/semantic_logger/appender/graylog.rb', line 28

def initialize(trace: GELF::DEBUG, debug: GELF::DEBUG, info: GELF::INFO, warn: GELF::WARN, error: GELF::ERROR, fatal: GELF::FATAL)
  @trace = trace
  @debug = debug
  @info  = info
  @warn  = warn
  @error = error
  @fatal = fatal
end

Instance Attribute Details

#debugObject

Returns the value of attribute debug.



26
27
28
# File 'lib/semantic_logger/appender/graylog.rb', line 26

def debug
  @debug
end

#errorObject

Returns the value of attribute error.



26
27
28
# File 'lib/semantic_logger/appender/graylog.rb', line 26

def error
  @error
end

#fatalObject

Returns the value of attribute fatal.



26
27
28
# File 'lib/semantic_logger/appender/graylog.rb', line 26

def fatal
  @fatal
end

#infoObject

Returns the value of attribute info.



26
27
28
# File 'lib/semantic_logger/appender/graylog.rb', line 26

def info
  @info
end

#traceObject

Returns the value of attribute trace.



26
27
28
# File 'lib/semantic_logger/appender/graylog.rb', line 26

def trace
  @trace
end

#warnObject

Returns the value of attribute warn.



26
27
28
# File 'lib/semantic_logger/appender/graylog.rb', line 26

def warn
  @warn
end

Instance Method Details

#[](level) ⇒ Object



37
38
39
# File 'lib/semantic_logger/appender/graylog.rb', line 37

def [](level)
  public_send(level)
end