Class: EXEL::Middleware::Logging

Inherits:
Object
  • Object
show all
Defined in:
lib/exel/middleware/logging.rb

Overview

Middleware to add a prefix to all messages logged during processor execution. The prefix is specified by the :log_prefix key in the context. Also logs start, finish, and failure of the processor execution.

Instance Method Summary collapse

Instance Method Details

#call(processor_class, context, _args, &block) ⇒ Object


8
9
10
# File 'lib/exel/middleware/logging.rb', line 8

def call(processor_class, context, _args, &block)
  EXEL::Logging.with_prefix("#{context[:log_prefix]}[#{processor_class}] ") { log_process(&block) }
end