diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2012-10-26 11:29:37 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2012-10-26 16:18:52 -0700 |
commit | 26f52b2ac1f8d6208bd017e6c0241e33147f5284 (patch) | |
tree | aed430bf509d874fe00aca9021556a5b8c9c155f | |
parent | 411378efcf3d6bfc33ff1f31dc0ebcc2abdd66f9 (diff) | |
download | rails-26f52b2ac1f8d6208bd017e6c0241e33147f5284.tar.gz rails-26f52b2ac1f8d6208bd017e6c0241e33147f5284.tar.bz2 rails-26f52b2ac1f8d6208bd017e6c0241e33147f5284.zip |
Job worker thread logs failed jobs too
-rw-r--r-- | activesupport/lib/active_support/queueing.rb | 2 | ||||
-rw-r--r-- | activesupport/test/queueing/threaded_consumer_test.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/queueing.rb b/activesupport/lib/active_support/queueing.rb index 0631f4e4a8..6de038ee0e 100644 --- a/activesupport/lib/active_support/queueing.rb +++ b/activesupport/lib/active_support/queueing.rb @@ -96,7 +96,7 @@ module ActiveSupport end def handle_exception(job, exception) - @logger.error "Job Error: #{exception.message}\n#{exception.backtrace.join("\n")}" + @logger.error "Job Error: #{job.inspect}\n#{exception.message}\n#{exception.backtrace.join("\n")}" end end end diff --git a/activesupport/test/queueing/threaded_consumer_test.rb b/activesupport/test/queueing/threaded_consumer_test.rb index ba3b08efc4..9dbb731969 100644 --- a/activesupport/test/queueing/threaded_consumer_test.rb +++ b/activesupport/test/queueing/threaded_consumer_test.rb @@ -68,7 +68,7 @@ class TestThreadConsumer < ActiveSupport::TestCase @queue.drain assert_equal 1, @logger.logged(:error).size - assert_match 'Job Error: RuntimeError: Error!', @logger.logged(:error).last + assert_match "Job Error: #{job.inspect}\nRuntimeError: Error!", @logger.logged(:error).last end test "logger defaults to stderr" do |