method

new

Importance_0
v3.0.0 - Show latest stable - 0 notes - Class: ActiveSupport::BufferedLogger
new(log, level = DEBUG) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activesupport/lib/active_support/buffered_logger.rb, line 41
    def initialize(log, level = DEBUG)
      @level         = level
      @buffer        = {}
      @auto_flushing = 1
      @guard = Mutex.new

      if log.respond_to?(:write)
        @log = log
      elsif File.exist?(log)
        @log = open(log, (File::WRONLY | File::APPEND))
        @log.sync = true
      else
        FileUtils.mkdir_p(File.dirname(log))
        @log = open(log, (File::WRONLY | File::APPEND | File::CREAT))
        @log.sync = true
      end
    end
Register or log in to add new notes.