class ActiveSupport::Logger
Public Class Methods
# File activesupport/lib/active_support/logger.rb, line 16 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
# File activesupport/lib/active_support/logger.rb, line 80 def initialize(*args) super @formatter = SimpleFormatter.new end
Calls superclass method
© 2004–2019 David Heinemeier Hansson
Licensed under the MIT License.