class ActiveSupport::Logger

Parent:
Logger
Included modules:
LoggerSilence

Public Class Methods

logger_outputs_to?(logger, *sources) Show source
# File activesupport/lib/active_support/logger.rb, line 15
def self.logger_outputs_to?(logger, *sources)
  logdev = logger.instance_variable_get("@logdev")
  logger_source = logdev.dev if logdev.respond_to?(:dev)
  sources.any? { |source| source == logger_source }
end

Returns true if the logger destination matches one of the sources

logger = Logger.new(STDOUT)
ActiveSupport::Logger.logger_outputs_to?(logger, STDOUT)
# => true
new(*args) Show source
# File activesupport/lib/active_support/logger.rb, line 79
def initialize(*args)
  super
  @formatter = SimpleFormatter.new
  after_initialize if respond_to? :after_initialize
end
Calls superclass method

Public Instance Methods

add(severity, message = nil, progname = nil, &block) Show source
# File activesupport/lib/active_support/logger.rb, line 85
def add(severity, message = nil, progname = nil, &block)
  return true if @logdev.nil? || (severity || UNKNOWN) < level
  super
end
Calls superclass method

© 2004–2018 David Heinemeier Hansson
Licensed under the MIT License.