Module: Waves::Logger
- Extended by:
- Forwardable
- Defined in:
- lib/waves/runtime/logger.rb
Class Method Summary collapse
-
.config ⇒ Object
Returns the active configuration for the logger.
-
.level ⇒ Object
Returns the logging level used to filter logging events.
-
.output ⇒ Object
Returns the object being used for output by the logger.
-
.start ⇒ Object
Starts the logger, using the active configuration to initialize it.
Class Method Details
.config ⇒ Object
Returns the active configuration for the logger.
12 |
# File 'lib/waves/runtime/logger.rb', line 12 def self.config ; @config ||= Waves.config.log ; end |
.level ⇒ Object
Returns the logging level used to filter logging events.
15 |
# File 'lib/waves/runtime/logger.rb', line 15 def self.level ; @level ||= ::Logger.const_get( config[:level].to_s.upcase || 'INFO' ) ; end |
.output ⇒ Object
Returns the object being used for output by the logger.
7 8 9 |
# File 'lib/waves/runtime/logger.rb', line 7 def self.output @output ||= ( config[:output] or $stderr ) end |
.start ⇒ Object
Starts the logger, using the active configuration to initialize it.
18 19 20 21 22 23 24 25 |
# File 'lib/waves/runtime/logger.rb', line 18 def self.start @log = config[:rotation] ? ::Logger.new( output, config[:rotation].to_sym ) : ::Logger.new( output ) @log.level = level @log.datetime_format = "%Y-%m-%d %H:%M:%S " self end |