Sha256: 17a87b6a379d453a217905f3f5a10d395c3e3dcb85bc58f1e36858e5a1df3e5f

Contents?: true

Size: 407 Bytes

Versions: 2

Compression:

Stored size: 407 Bytes

Contents

require 'logger'

class Logger #:nodoc:
  # Silences the logger for the duration of the block.
  def silence(temporary_level = Logger::ERROR)
    old_logger_level, self.level = level, temporary_level
    yield
  ensure
    self.level = old_logger_level
  end

  private
    remove_const "Format"
    Format = "%s\n"
    def format_message(severity, timestamp, msg, progname)
      Format % [msg]
    end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
activesupport-1.1.1 lib/active_support/clean_logger.rb
activesupport-1.1.0 lib/active_support/clean_logger.rb