Module: Vx::Common::TaggedLogging

Defined in:
lib/vx/common/tagged_logging.rb

Defined Under Namespace

Classes: Formatter

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.new(logger) ⇒ Object



58
59
60
61
62
# File 'lib/vx/common/tagged_logging.rb', line 58

def self.new(logger)
  # Ensure we set a default formatter so we aren't extending nil!
  logger.formatter = Formatter.new
  logger.extend(self)
end

Instance Method Details

#flushObject



74
75
76
77
# File 'lib/vx/common/tagged_logging.rb', line 74

def flush
  clear_tags!
  super if defined?(super)
end

#tagged(*tags) ⇒ Object



70
71
72
# File 'lib/vx/common/tagged_logging.rb', line 70

def tagged(*tags)
  formatter.tagged(*tags) { yield self }
end