Namespace
Class
Methods
Included Modules
Class Public methods
logger_outputs_to?(logger, *sources)
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
# File activesupport/lib/active_support/logger.rb, line 17
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
🔎 See on GitHub
new(*args)
📝 Source code
# File activesupport/lib/active_support/logger.rb, line 81
def initialize(*args)
super
@formatter = SimpleFormatter.new
after_initialize if respond_to? :after_initialize
end
🔎 See on GitHub
Instance Public methods
add(severity, message = nil, progname = nil, &block)
📝 Source code
# File activesupport/lib/active_support/logger.rb, line 87
def add(severity, message = nil, progname = nil, &block)
return true if @logdev.nil? || (severity || UNKNOWN) < level
super
end
🔎 See on GitHub