Skip to content

Commit

Permalink
make the tagged formatter extend the existing formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Mar 12, 2012
1 parent 0f5b32c commit 7f40b9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions activesupport/lib/active_support/tagged_logging.rb
Expand Up @@ -13,7 +13,7 @@ module ActiveSupport
# This is used by the default Rails.logger as configured by Railties to make it easy to stamp log lines
# with subdomains, request ids, and anything else to aid debugging of multi-user production applications.
module TaggedLogging
class Formatter < ActiveSupport::Logger::SimpleFormatter # :nodoc:
module Formatter # :nodoc:
# This method is invoked when a log event occurs
def call(severity, timestamp, progname, msg)
super(severity, timestamp, progname, "#{tags_text}#{msg}")
Expand All @@ -37,7 +37,7 @@ def tags_text
end

def self.new(logger)
logger.formatter = Formatter.new
logger.formatter.extend Formatter
logger.extend(self)
end

Expand Down

0 comments on commit 7f40b9c

Please sign in to comment.