method
new
new(log, level = DEBUG)
public
Hide source
# File activesupport/lib/active_support/buffered_logger.rb, line 42 def initialize(log, level = DEBUG) @level = level @buffer = Hash.new { |h,k| h[k] = [] } @auto_flushing = 1 @guard = Mutex.new if log.respond_to?(:write) @log = log elsif File.exist?(log) @log = open_log(log, (File::WRONLY | File::APPEND)) else FileUtils.mkdir_p(File.dirname(log)) @log = open_log(log, (File::WRONLY | File::APPEND | File::CREAT)) end end