method
new
v2.0.3 -
Show latest stable
- Class:
ActiveSupport::BufferedLogger
new(log, level = DEBUG)public
No documentation available.
# File activesupport/lib/active_support/buffered_logger.rb, line 38
def initialize(log, level = DEBUG)
@level = level
@buffer = []
@auto_flushing = 1
if log.respond_to?(:write)
@log = log
elsif File.exist?(log)
@log = open(log, (File::WRONLY | File::APPEND))
@log.sync = true
else
@log = open(log, (File::WRONLY | File::APPEND | File::CREAT))
@log.sync = true
@log.write("# Logfile created on %s" % [Time.now.to_s])
end
end