Inspired by the buffered logger idea by Ezra
Namespace
Methods
- A
- C
- F
- L
- N
- O
- R
- S
Included Modules
Constants
MAX_BUFFER_SIZE | = | 1000 |
Attributes
[R] | auto_flushing |
Class Public methods
# File activesupport/lib/active_support/buffered_logger.rb, line 47 def initialize(log, level = DEBUG) @level = level @log_dest = log unless log.respond_to?(:write) unless File.exist?(File.dirname(log)) ActiveSupport::Deprecation.warn("Automatic directory creation for '#{log}' is deprecated. Please make sure the directory for your log file exists before creating the logger. ") FileUtils.mkdir_p(File.dirname(log)) end end @log = open_logfile log end
Set to false to disable the silencer
Instance Public methods
Set the auto-flush period. Set to true to flush after every log message, to an integer to flush every N messages, or to false, nil, or zero to never auto-flush. If you turn auto-flushing off, be sure to regularly flush the log yourself – it will eat up memory until you do.
Silences the logger for the duration of the block.