Class: Solid::Process::EventLogs::BasicLoggerListener

Inherits:
Object
  • Object
show all
Includes:
ActiveSupport::Configurable, Result::EventLogs::Listener
Defined in:
lib/solid/process/event_logs/basic_logger_listener.rb

Defined Under Namespace

Modules: MessagesNesting

Instance Method Summary collapse

Instance Method Details

#before_interruption(exception:, event_logs:) ⇒ Object



69
70
71
72
73
74
75
76
77
# File 'lib/solid/process/event_logs/basic_logger_listener.rb', line 69

def before_interruption(exception:, event_logs:)
  messages = MessagesNesting.map(event_logs)

  logger.info messages.join("\n")

  cleaned_backtrace = backtrace_cleaner.clean(exception.backtrace).join("\n  ")

  logger.error "\nException:\n  #{exception.message} (#{exception.class})\n\nBacktrace:\n  #{cleaned_backtrace}"
end

#on_finish(event_logs:) ⇒ Object



63
64
65
66
67
# File 'lib/solid/process/event_logs/basic_logger_listener.rb', line 63

def on_finish(event_logs:)
  messages = MessagesNesting.map(event_logs)

  logger.info messages.join("\n")
end