aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/log_subscriber.rb
diff options
context:
space:
mode:
authorEthan <ethan@unth>2017-05-18 16:07:35 -0700
committerEthan <ethan@unth>2017-05-24 12:54:27 -0700
commit1c5f5af8c92286ce3f5cb03379098249432faafd (patch)
tree9fb8e59c5c042b1fc67cd4a72eb22c82b1978de5 /activesupport/lib/active_support/log_subscriber.rb
parent8300234f9f79b78b78ba1cb90739c776fca8e030 (diff)
downloadrails-1c5f5af8c92286ce3f5cb03379098249432faafd.tar.gz
rails-1c5f5af8c92286ce3f5cb03379098249432faafd.tar.bz2
rails-1c5f5af8c92286ce3f5cb03379098249432faafd.zip
check that logger is defined in log subscriber rescue before logging
Diffstat (limited to 'activesupport/lib/active_support/log_subscriber.rb')
-rw-r--r--activesupport/lib/active_support/log_subscriber.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/log_subscriber.rb b/activesupport/lib/active_support/log_subscriber.rb
index fd00b4bf83..e704e18fb9 100644
--- a/activesupport/lib/active_support/log_subscriber.rb
+++ b/activesupport/lib/active_support/log_subscriber.rb
@@ -82,7 +82,9 @@ module ActiveSupport
def finish(name, id, payload)
super if logger
rescue => e
- logger.error "Could not log #{name.inspect} event. #{e.class}: #{e.message} #{e.backtrace}"
+ if logger
+ logger.error "Could not log #{name.inspect} event. #{e.class}: #{e.message} #{e.backtrace}"
+ end
end
private