Class: Logatron::Configuration
- Inherits:
-
Object
- Object
- Logatron::Configuration
- Defined in:
- lib/logatron/configuration.rb
Instance Attribute Summary collapse
-
#app_id ⇒ Object
Returns the value of attribute app_id.
-
#backtrace_cleaner ⇒ Object
readonly
Returns the value of attribute backtrace_cleaner.
-
#error_formatter ⇒ Object
Returns the value of attribute error_formatter.
-
#host ⇒ Object
Returns the value of attribute host.
-
#level ⇒ Object
Returns the value of attribute level.
-
#loggable_levels ⇒ Object
readonly
Returns the value of attribute loggable_levels.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#transformer ⇒ Object
Returns the value of attribute transformer.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
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_id ⇒ Object
Returns the value of attribute app_id.
26 27 28 |
# File 'lib/logatron/configuration.rb', line 26 def app_id @app_id end |
#backtrace_cleaner ⇒ Object (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_formatter ⇒ Object
Returns the value of attribute error_formatter.
26 27 28 |
# File 'lib/logatron/configuration.rb', line 26 def error_formatter @error_formatter end |
#host ⇒ Object
Returns the value of attribute host.
26 27 28 |
# File 'lib/logatron/configuration.rb', line 26 def host @host end |
#level ⇒ Object
Returns the value of attribute level.
26 27 28 |
# File 'lib/logatron/configuration.rb', line 26 def level @level end |
#loggable_levels ⇒ Object (readonly)
Returns the value of attribute loggable_levels.
27 28 29 |
# File 'lib/logatron/configuration.rb', line 27 def loggable_levels @loggable_levels end |
#logger ⇒ Object
Returns the value of attribute logger.
26 27 28 |
# File 'lib/logatron/configuration.rb', line 26 def logger @logger end |
#transformer ⇒ Object
Returns the value of attribute transformer.
26 27 28 |
# File 'lib/logatron/configuration.rb', line 26 def transformer @transformer end |