Class: Logatron::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/logatron/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/logatron/configuration.rb', line 29

def initialize
  @logger = Logger.new(STDOUT)
  @app_id = 'N/A'
  @transformer = proc { |x| x.to_json }
  @host = `hostname`.chomp
  @level = INFO
  level_threshold = SEVERITY_MAP[@level]
  levels = Logatron::SEVERITY_MAP.keys
  @loggable_levels = levels.select { |level| SEVERITY_MAP[level] >= level_threshold }
  @backtrace_cleaner = Logatron::BacktraceCleaner.new
  @error_formatter = Logatron::ErrorFormatter.new
end

Instance Attribute Details

#app_idObject

Returns the value of attribute app_id.



26
27
28
# File 'lib/logatron/configuration.rb', line 26

def app_id
  @app_id
end

#backtrace_cleanerObject (readonly)

Returns the value of attribute backtrace_cleaner.



27
28
29
# File 'lib/logatron/configuration.rb', line 27

def backtrace_cleaner
  @backtrace_cleaner
end

#error_formatterObject

Returns the value of attribute error_formatter.



26
27
28
# File 'lib/logatron/configuration.rb', line 26

def error_formatter
  @error_formatter
end

#hostObject

Returns the value of attribute host.



26
27
28
# File 'lib/logatron/configuration.rb', line 26

def host
  @host
end

#levelObject

Returns the value of attribute level.



26
27
28
# File 'lib/logatron/configuration.rb', line 26

def level
  @level
end

#loggable_levelsObject (readonly)

Returns the value of attribute loggable_levels.



27
28
29
# File 'lib/logatron/configuration.rb', line 27

def loggable_levels
  @loggable_levels
end

#loggerObject

Returns the value of attribute logger.



26
27
28
# File 'lib/logatron/configuration.rb', line 26

def logger
  @logger
end

#transformerObject

Returns the value of attribute transformer.



26
27
28
# File 'lib/logatron/configuration.rb', line 26

def transformer
  @transformer
end