Inspired by the buffered logger idea by Ezra

Methods
A
C
F
L
N
O
R
S
Included Modules
Classes and Modules
Constants
MAX_BUFFER_SIZE = 1000
Attributes
[R] auto_flushing
Class Public methods
new(log, level = DEBUG)
    # File activesupport/lib/active_support/buffered_logger.rb, line 47
47:     def initialize(log, level = DEBUG)
48:       @log_dest      = log
49: 
50:       unless log.respond_to?(:write)
51:         unless File.exist?(File.dirname(log))
52:           ActiveSupport::Deprecation.warn("Automatic directory creation for '\#{log}' is deprecated.  Please make sure the directory for your log file exists before creating the logger.\n")
53:           FileUtils.mkdir_p(File.dirname(log))
54:         end
55:       end
56: 
57:       @log = open_logfile log
58:       self.level = level
59:     end
silencer

Set to false to disable the silencer

    # File activesupport/lib/active_support/buffered_logger.rb, line 26
26:     cattr_accessor :silencer
Instance Public methods
add(severity, message = nil, progname = nil, &block)
    # File activesupport/lib/active_support/buffered_logger.rb, line 80
80:     def add(severity, message = nil, progname = nil, &block)
81:       @log.add(severity, message, progname, &block)
82:     end
auto_flushing=(period)

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.

     # File activesupport/lib/active_support/buffered_logger.rb, line 105
105:     def auto_flushing=(period)
106:     end
close()
     # File activesupport/lib/active_support/buffered_logger.rb, line 118
118:     def close
119:       @log.close
120:     end
flush()
     # File activesupport/lib/active_support/buffered_logger.rb, line 109
109:     def flush
110:     end
level()
    # File activesupport/lib/active_support/buffered_logger.rb, line 72
72:     def level
73:       @log.level
74:     end
level=(l)
    # File activesupport/lib/active_support/buffered_logger.rb, line 76
76:     def level=(l)
77:       @log.level = l
78:     end
open_log(log, mode)
    # File activesupport/lib/active_support/buffered_logger.rb, line 64
64:     def open_log(log, mode)
65:       open(log, mode).tap do |open_log|
66:         open_log.set_encoding(Encoding::BINARY) if open_log.respond_to?(:set_encoding)
67:         open_log.sync = true
68:       end
69:     end
respond_to?(method, include_private = false)
     # File activesupport/lib/active_support/buffered_logger.rb, line 113
113:     def respond_to?(method, include_private = false)
114:       return false if method.to_s == "flush"
115:       super
116:     end
silence(temporary_level = ERROR)

Silences the logger for the duration of the block.

    # File activesupport/lib/active_support/buffered_logger.rb, line 30
30:     def silence(temporary_level = ERROR)
31:       if silencer
32:         begin
33:           logger = self.class.new @log_dest.dup, temporary_level
34:           yield logger
35:         ensure
36:           logger.close
37:         end
38:       else
39:         yield self
40:       end
41:     end