Permalink
Browse files

Merge pull request #16633 from tgxworld/prefer_log_message_through_block

Pass logging message through block.
  • Loading branch information...
2 parents 6fa5f85 + fb74023 commit f020f302ad8e3be9ccd06099e59337afa1bb5000 @senny senny committed Aug 22, 2014
Showing with 4 additions and 4 deletions.
  1. +4 −4 activejob/lib/active_job/logging.rb
@@ -52,19 +52,19 @@ def logger_tagged_by_active_job?
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

0 comments on commit f020f30

Please sign in to comment.