Module: LogrageActivejob

Defined in:
lib/lograge_activejob.rb,
lib/lograge_activejob/railtie.rb,
lib/lograge_activejob/version.rb,
lib/lograge_activejob/log_subscriber.rb

Defined Under Namespace

Classes: Config, LogSubscriber, Railtie

Constant Summary collapse

VERSION =
'0.3.2'

Class Method Summary collapse

Class Method Details

.custom_options(event) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/lograge_activejob.rb', line 12

def custom_options(event)
  if @@custom_options.respond_to?(:call)
    @@custom_options.call(event)
  else
    @@custom_options
  end
end

.setup(app) ⇒ Object



20
21
22
23
24
# File 'lib/lograge_activejob.rb', line 20

def setup(app)
  LogrageActivejob.logger = app.config.lograge_activejob.logger
  LogrageActivejob.custom_options = app.config.lograge_activejob.custom_options
  LogrageActivejob::LogSubscriber.attach_to :active_job
end