From 53948bf3a3628a96d5608653618d3770e5acc23b Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 22 May 2014 21:11:21 +0200 Subject: No need for the ClassMethods module --- lib/active_job/logging.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/active_job/logging.rb b/lib/active_job/logging.rb index f4a33ffe19..ede1606027 100644 --- a/lib/active_job/logging.rb +++ b/lib/active_job/logging.rb @@ -4,11 +4,9 @@ module ActiveJob module Logging extend ActiveSupport::Concern - module ClassMethods - mattr_accessor(:logger) { ActiveSupport::Logger.new(STDOUT) } - end - included do + cattr_accessor(:logger) { ActiveSupport::TaggedLogging.new(ActiveSupport::Logger.new(STDOUT)) } + before_enqueue do |job| if job.enqueued_at ActiveSupport::Notifications.instrument "enqueue_at.active_job", @@ -24,8 +22,7 @@ module ActiveJob adapter: job.class.queue_adapter, job: job.class, args: job.arguments end end - - + class LogSubscriber < ActiveSupport::LogSubscriber def enqueue(event) info "Enqueued #{event.payload[:job].name} to #{queue_name(event)}" + args_info(event) -- cgit v1.2.3