Class: Proxy::Dynflow::Log::ProxyStructuredFormater

Inherits:
Dynflow::LoggerAdapters::Formatters::Abstract
  • Object
show all
Defined in:
lib/smart_proxy_dynflow/log.rb

Instance Method Summary collapse

Instance Method Details

#format(message) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/smart_proxy_dynflow/log.rb', line 28

def format(message)
  if message.is_a?(Exception)
    subject = "#{message.message} (#{message.class})"
    if @base.respond_to?(:exception)
      @base.exception("Error details", message)
      subject
    else
      "#{subject}\n#{message.backtrace.join("\n")}"
    end
  else
    @original_formatter.call(severity, datetime, prog_name, message)
  end
end