Module: ActiveLogger::TaggedLogging
- Defined in:
- lib/active_logger/tagged_logging.rb
Overview
:nodoc:
Defined Under Namespace
Modules: LocalTagStorage
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.new(logger) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/active_logger/tagged_logging.rb', line 16 def self.new(logger) logger = logger.dup logger.formatter = if logger.formatter logger.formatter.dup else # Ensure we set a default formatter so we aren't extending nil! ActiveLogger::Formatters::Default.new end logger.extend(self) end |
Instance Method Details
#flush ⇒ Object
43 44 45 46 |
# File 'lib/active_logger/tagged_logging.rb', line 43 def flush super if defined?(super) end |
#tagged(*tags) ⇒ Object
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/active_logger/tagged_logging.rb', line 32 def tagged(*) if block_given? formatter.tagged(*) { yield self } else logger = ActiveLogger::TaggedLogging.new(self) logger.formatter.extend LocalTagStorage logger.(*formatter., *) logger end end |