Module: ActiveSupport::TaggedLogging::Formatter

Defined in:
lib/contextual_logger/overrides/active_support/tagged_logging/formatter.rb

Instance Method Summary collapse

Instance Method Details

#call(severity, timestamp, progname, msg) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/contextual_logger/overrides/active_support/tagged_logging/formatter.rb', line 6

def call(severity, timestamp, progname, msg)
  msg_with_tags = case msg
                  when Hash
                    msg.merge(log_tags: current_tags.join(', '))
                  else
                    "#{tags_text}#{msg}"
                  end

  super(severity, timestamp, progname, msg_with_tags)
end