Module: Istox::Logging::HashLogging::Formatter

Includes:
ActiveSupport::TaggedLogging::Formatter
Defined in:
lib/istox/logging/hash_logging.rb

Instance Method Summary collapse

Instance Method Details

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



15
16
17
18
19
20
21
22
23
# File 'lib/istox/logging/hash_logging.rb', line 15

def call(severity, timestamp, progname, msg)
  tagged_message = case
                   when msg.is_a?(Hash) then tags_text.present? ? msg.merge(tags: tags_text) : msg
                   when tags_text.present? then { message: msg, tag: tags_text }
                   else msg
                   end

  self.class.instance_method(:call).bind(self).call(severity, timestamp, progname, tagged_message)
end