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
#[], #[]=, #merge!, symbolize_keys, #to_h
Constructor Details
#initialize(options = {}) ⇒ LoggingConfig
Returns a new instance of LoggingConfig.
217 218 219 220 221 222 223 |
# File 'lib/coradoc/configurable.rb', line 217 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.
215 216 217 |
# File 'lib/coradoc/configurable.rb', line 215 def colorize @colorize end |
#level ⇒ Symbol
Returns Log level (:debug, :info, :warn, :error).
206 207 208 |
# File 'lib/coradoc/configurable.rb', line 206 def level @level end |
#output ⇒ IO?
Returns Log output destination.
212 213 214 |
# File 'lib/coradoc/configurable.rb', line 212 def output @output end |
#timestamps ⇒ Boolean
Returns Include timestamps.
209 210 211 |
# File 'lib/coradoc/configurable.rb', line 209 def @timestamps end |