diff options
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 |