Wraps any standard Logger class to provide tagging capabilities. Examples:

Logger = ActiveSupport::TaggedLogging.new(Logger.new(STDOUT))
Logger.tagged("BCX") { Logger.info "Stuff" }                            # Logs "[BCX] Stuff"
Logger.tagged("BCX", "Jason") { Logger.info "Stuff" }                   # Logs "[BCX] [Jason] Stuff"
Logger.tagged("BCX") { Logger.tagged("Jason") { Logger.info "Stuff" } } # Logs "[BCX] [Jason] Stuff"

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.

Methods
A
C
F
M
N
P
R
S
T
Class Public methods
new(logger)
# File activesupport/lib/active_support/tagged_logging.rb, line 16
def initialize(logger)
  @logger = logger
end
Instance Public methods
add(severity, message = nil, progname = nil, &block)
# File activesupport/lib/active_support/tagged_logging.rb, line 46
def add(severity, message = nil, progname = nil, &block)
  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
clear_tags!()
# File activesupport/lib/active_support/tagged_logging.rb, line 37
def clear_tags!
  current_tags.clear
end
flush()
# File activesupport/lib/active_support/tagged_logging.rb, line 66
def flush
  clear_tags!
  @logger.flush if @logger.respond_to?(:flush)
end
method_missing(method, *args)
# File activesupport/lib/active_support/tagged_logging.rb, line 71
def method_missing(method, *args)
  @logger.send(method, *args)
end
pop_tags(size = 1)
# File activesupport/lib/active_support/tagged_logging.rb, line 33
def pop_tags(size = 1)
  current_tags.pop size
end
push_tags(*tags)
# File activesupport/lib/active_support/tagged_logging.rb, line 27
def push_tags(*tags)
  tags.flatten.reject(&:blank?).tap do |new_tags|
    current_tags.concat new_tags
  end
end
respond_to?(*args)
# File activesupport/lib/active_support/tagged_logging.rb, line 76
def respond_to?(*args)
  super || @logger.respond_to?(*args)
end
respond_to_missing?(*args)
# File activesupport/lib/active_support/tagged_logging.rb, line 80
def respond_to_missing?(*args)
  @logger.respond_to? *args
end
silence(temporary_level = Logger::ERROR, &block)
# File activesupport/lib/active_support/tagged_logging.rb, line 41
def silence(temporary_level = Logger::ERROR, &block)
  @logger.silence(temporary_level, &block)
end
tagged(*tags)
# File activesupport/lib/active_support/tagged_logging.rb, line 20
def tagged(*tags)
  new_tags = push_tags(*tags)
  yield self
ensure
  pop_tags(new_tags.size)
end