aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/tagged_logging.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/tagged_logging.rb')
-rw-r--r--activesupport/lib/active_support/tagged_logging.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/tagged_logging.rb b/activesupport/lib/active_support/tagged_logging.rb
index 8af6fa4ba7..33810442da 100644
--- a/activesupport/lib/active_support/tagged_logging.rb
+++ b/activesupport/lib/active_support/tagged_logging.rb
@@ -21,10 +21,10 @@ module ActiveSupport
end
def tagged(*tags)
- new_tags = push_tags *tags
+ new_tags = push_tags(*tags)
yield self
ensure
- pop_tags new_tags.size
+ pop_tags(new_tags.size)
end
def push_tags(*tags)
@@ -55,6 +55,8 @@ module ActiveSupport
end
def self.new(logger)
+ # Ensure we set a default formatter so we aren't extending nil!
+ logger.formatter ||= ActiveSupport::Logger::SimpleFormatter.new
logger.formatter.extend Formatter
logger.extend(self)
end