Class: AcidicJob::Logger

Inherits:
Logger
  • Object
show all
Defined in:
lib/acidic_job/logger.rb

Instance Method Summary collapse

Instance Method Details

#inspect_name(obj) ⇒ Object



17
18
19
20
21
# File 'lib/acidic_job/logger.rb', line 17

def inspect_name(obj)
  return if obj.nil?

  obj.inspect.split.first.remove("#<")
end

#log_run_event(msg, job = nil, run = nil) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/acidic_job/logger.rb', line 8

def log_run_event(msg, job = nil, run = nil)
  tags = [
    run&.idempotency_key,
    inspect_name(job)
  ].compact

  tagged(*tags) { debug(msg) }
end