diff options
author | Carson Reinke <carson@reinke.co> | 2013-01-10 13:36:05 -0500 |
---|---|---|
committer | Carson Reinke <carson@reinke.co> | 2013-07-01 10:11:43 -0400 |
commit | 4265f1bccbabc293e87cc8433a5573dcb7fa5a60 (patch) | |
tree | 9a47b2bb2008e2334b20f9d375f99326a70e0c12 /activesupport/lib/active_support/tagged_logging.rb | |
parent | 9a8f59340b86151b183d6561a94b953371c3daf3 (diff) | |
download | rails-4265f1bccbabc293e87cc8433a5573dcb7fa5a60.tar.gz rails-4265f1bccbabc293e87cc8433a5573dcb7fa5a60.tar.bz2 rails-4265f1bccbabc293e87cc8433a5573dcb7fa5a60.zip |
Incorrectly providing program name the same as log message even when block is not provided.
Diffstat (limited to 'activesupport/lib/active_support/tagged_logging.rb')
-rw-r--r-- | activesupport/lib/active_support/tagged_logging.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/tagged_logging.rb b/activesupport/lib/active_support/tagged_logging.rb index 7e7f7ecfb2..6fff3bc0d4 100644 --- a/activesupport/lib/active_support/tagged_logging.rb +++ b/activesupport/lib/active_support/tagged_logging.rb @@ -44,7 +44,14 @@ module ActiveSupport deprecate :silence def add(severity, message = nil, progname = nil, &block) - message = (block_given? ? block.call : progname) if message.nil? + if message.nil? + if block_given? + message = block.call + else + message = progname + progname = nil #No instance variable for this like Logger + end + end @logger.add(severity, "#{tags_text}#{message}", progname) end |