module KeyValueLogging::TaggedLogging
Public Class Methods
new(logger, key_value_format = 'default') { |logger| ... }
click to toggle source
# File lib/key_value_logging/tagged_logging.rb, line 62 def self.new(logger, key_value_format = 'default') yield(logger) if block_given? # Ensure we set a default formatter so we aren't extending nil! logger.formatter ||= ActiveSupport::Logger::SimpleFormatter.new logger.formatter.extend Formatter logger.formatter.key_value_format = key_value_format logger.extend(self) end
Public Instance Methods
flush()
click to toggle source
Calls superclass method
# File lib/key_value_logging/tagged_logging.rb, line 77 def flush clear_tags! super if defined?(super) end
tagged(tags = {}) { |self| ... }
click to toggle source
# File lib/key_value_logging/tagged_logging.rb, line 73 def tagged(tags = {}) formatter.tagged(tags) { yield self } end