Skip to Content Skip to Search
edge
class ActiveSupport::Logger < Logger
Methods
L
N
Included Modules

Public class methods

logger_outputs_to?(logger, *sources)

Permalink

Returns true if the logger destination matches one of the sources

logger = Logger.new(STDOUT)
ActiveSupport::Logger.logger_outputs_to?(logger, STDOUT)
# => true
Source code GitHub
# 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

new(*args, **kwargs)

Permalink
Source code GitHub
# File activesupport/lib/active_support/logger.rb, line 22
def initialize(*args, **kwargs)
  super
  @formatter ||= SimpleFormatter.new
end
Namespace
Definition files