mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Pass logging message through block.
This follows the good practice listed on http://guides.rubyonrails.org/debugging_rails_applications.html#impact-of-logs-on-performance
This commit is contained in:
parent
880a1d8ac9
commit
fb740239dc
1 changed files with 4 additions and 4 deletions
|
@ -52,19 +52,19 @@ module ActiveJob
|
|||
|
||||
class LogSubscriber < ActiveSupport::LogSubscriber
|
||||
def enqueue(event)
|
||||
info "Enqueued #{event.payload[:job].name} (Job ID: #{event.payload[:job_id]}) to #{queue_name(event)}" + args_info(event)
|
||||
info { "Enqueued #{event.payload[:job].name} (Job ID: #{event.payload[:job_id]}) to #{queue_name(event)}" + args_info(event) }
|
||||
end
|
||||
|
||||
def enqueue_at(event)
|
||||
info "Enqueued #{event.payload[:job].name} (Job ID: #{event.payload[:job_id]}) to #{queue_name(event)} at #{enqueued_at(event)}" + args_info(event)
|
||||
info { "Enqueued #{event.payload[:job].name} (Job ID: #{event.payload[:job_id]}) to #{queue_name(event)} at #{enqueued_at(event)}" + args_info(event) }
|
||||
end
|
||||
|
||||
def perform_start(event)
|
||||
info "Performing #{event.payload[:job].name} from #{queue_name(event)}" + args_info(event)
|
||||
info { "Performing #{event.payload[:job].name} from #{queue_name(event)}" + args_info(event) }
|
||||
end
|
||||
|
||||
def perform(event)
|
||||
info "Performed #{event.payload[:job].name} from #{queue_name(event)} in #{event.duration.round(2).to_s}ms"
|
||||
info { "Performed #{event.payload[:job].name} from #{queue_name(event)} in #{event.duration.round(2).to_s}ms" }
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Reference in a new issue