module Lumberjack::TaggedLoggerSupport
Methods to make Lumberjack::Logger
API compatible with ActiveSupport::TaggedLogger.
Public Instance Methods
tagged(*tags, &block)
click to toggle source
Compatibility with ActiveSupport::TaggedLogging which only supports adding tags as strings. If a tag looks like “key:value” or “key=value”, it will be added as a key value pair. Otherwise it will be appended to a list named “tagged”.
# File lib/lumberjack/tagged_logger_support.rb, line 43 def tagged(*tags, &block) tag_hash = {} tags.flatten.each do |tag| tagged_values = Array(tag_hash["tagged"] || self.tags["tagged"]) tag_hash["tagged"] = tagged_values + [tag] end tag(tag_hash, &block) end