Class: Kitchen::Logger
- Inherits:
-
Object
- Object
- Kitchen::Logger
- Includes:
- Logger::Severity
- Defined in:
- lib/kitchen/logger.rb
Overview
Logging implementation for Kitchen. By default the console/stdout output
will be displayed differently than the file log output. Therefor, this
class wraps multiple loggers that conform to the stdlib Logger
class
behavior.
Defined Under Namespace
Classes: LogdevLogger, StdoutLogger
Instance Attribute Summary collapse
-
#logdev ⇒ Object
readonly
Returns the value of attribute logdev.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Logger
constructor
A new instance of Logger.
Constructor Details
#initialize(options = {}) ⇒ Logger
Returns a new instance of Logger.
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/kitchen/logger.rb', line 36 def initialize( = {}) color = [:color] @loggers = [] @loggers << @logdev = logdev_logger([:logdev]) if [:logdev] @loggers << stdout_logger([:stdout], color) if [:stdout] @loggers << stdout_logger(STDOUT, color) if @loggers.empty? self.progname = [:progname] || "Kitchen" self.level = [:level] || default_log_level end |
Instance Attribute Details
#logdev ⇒ Object (readonly)
Returns the value of attribute logdev.
34 35 36 |
# File 'lib/kitchen/logger.rb', line 34 def logdev @logdev end |