Class: Coradoc::Configurable::LoggingConfig
- Inherits:
-
ConfigSection
- Object
- ConfigSection
- Coradoc::Configurable::LoggingConfig
- Defined in:
- lib/coradoc/configurable.rb
Overview
Logging configuration section
Instance Attribute Summary collapse
-
#colorize ⇒ Boolean
Colorize output.
-
#level ⇒ Symbol
Log level (:debug, :info, :warn, :error).
-
#output ⇒ IO?
Log output destination.
-
#timestamps ⇒ Boolean
Include timestamps.
Attributes inherited from ConfigSection
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ LoggingConfig
constructor
A new instance of LoggingConfig.
Methods inherited from ConfigSection
#[], #[]=, #after_initialize, #merge!, symbolize_keys, #to_h
Constructor Details
#initialize(options = {}) ⇒ LoggingConfig
Returns a new instance of LoggingConfig.
221 222 223 224 225 226 227 |
# File 'lib/coradoc/configurable.rb', line 221 def initialize( = {}) super @level = @options.fetch(:level, :info) @timestamps = @options.fetch(:timestamps, true) @output = @options.fetch(:output, $stderr) @colorize = @options.fetch(:colorize, true) end |
Instance Attribute Details
#colorize ⇒ Boolean
Returns Colorize output.
219 220 221 |
# File 'lib/coradoc/configurable.rb', line 219 def colorize @colorize end |
#level ⇒ Symbol
Returns Log level (:debug, :info, :warn, :error).
210 211 212 |
# File 'lib/coradoc/configurable.rb', line 210 def level @level end |
#output ⇒ IO?
Returns Log output destination.
216 217 218 |
# File 'lib/coradoc/configurable.rb', line 216 def output @output end |
#timestamps ⇒ Boolean
Returns Include timestamps.
213 214 215 |
# File 'lib/coradoc/configurable.rb', line 213 def @timestamps end |