module ActiveJob::Logging

Private Instance Methods

logger_tagged_by_active_job?() click to toggle source
# File lib/active_job/logging.rb, line 49
def logger_tagged_by_active_job?
  logger.send(:current_tags).include?("ActiveJob")
end
tag_logger(*tags) { || ... } click to toggle source
# File lib/active_job/logging.rb, line 40
def tag_logger(*tags)
  if logger.respond_to?(:tagged)
    tags.unshift "ActiveJob" unless logger_tagged_by_active_job?
    ActiveJob::Base.logger.tagged(*tags){ yield }
  else
    yield
  end
end