Class: EventedBluepill::Logger
- Inherits:
-
Object
- Object
- EventedBluepill::Logger
- Defined in:
- lib/evented_bluepill/logger.rb
Defined Under Namespace
Classes: LoggerAdapter
Constant Summary collapse
- LOG_METHODS =
[:emerg, :alert, :crit, :err, :warning, :notice, :info, :debug]
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Logger
constructor
A new instance of Logger.
- #prefix_with(prefix) ⇒ Object
- #reopen ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Logger
Returns a new instance of Logger.
10 11 12 13 14 15 16 |
# File 'lib/evented_bluepill/logger.rb', line 10 def initialize( = {}) @options = @logger = [:logger] || self.create_logger @prefix = [:prefix] @stdout = [:stdout] @prefixes = {} end |
Instance Method Details
#prefix_with(prefix) ⇒ Object
35 36 37 |
# File 'lib/evented_bluepill/logger.rb', line 35 def prefix_with(prefix) @prefixes[prefix] ||= self.class.new(:logger => self, :prefix => prefix) end |
#reopen ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/evented_bluepill/logger.rb', line 39 def reopen if @logger.is_a?(self.class) @logger.reopen else @logger = create_logger end end |