class method self.new

Ruby on Rails 3.0.20

Since v2.2.3 Last seen in v4.0.13

Available in: v2.2.3 v2.3.18 v3.0.20 v3.1.12 v3.2.22.5 v4.0.13

Signature

self.new(log, level = DEBUG)

No documentation comment.

Parameters

log req
level opt = DEBUG
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

Defined in activesupport/lib/active_support/buffered_logger.rb line 42 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveSupport::BufferedLogger

Type at least 2 characters to search.

↑↓ navigate · open · esc close