aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2014-05-22 21:11:21 +0200
committerDavid Heinemeier Hansson <david@loudthinking.com>2014-05-22 21:11:21 +0200
commit53948bf3a3628a96d5608653618d3770e5acc23b (patch)
treee4b8b23e68da39b147a4a7fad1c76019831b456a /lib
parent26dc3ea7b8ac770b8265fa8ce97ed67158cfb68a (diff)
downloadrails-53948bf3a3628a96d5608653618d3770e5acc23b.tar.gz
rails-53948bf3a3628a96d5608653618d3770e5acc23b.tar.bz2
rails-53948bf3a3628a96d5608653618d3770e5acc23b.zip
No need for the ClassMethods module
Diffstat (limited to 'lib')
-rw-r--r--lib/active_job/logging.rb9
1 files changed, 3 insertions, 6 deletions
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)