require 'logger'

class Logger

  private

  # Dictate the way in which this logger should format the messages
  # it displays. This method requires a block. The block should return
  # formatted strings given severity, timestamp, msg, progname.
  #
  # Useless example:
  #
  # logger = Logger.new
  # logger.format do |severity, timestamp, msg, progname|
  #   "#{progname}@#{timestamp} - #{severity}::#{msg}"
  # end
  #
  def format(&format_proc)
    raise 'block expected' unless format_proc
    @format_proc = format_proc
  end

  # hackish use of *args, give me some love
  def format_message(*args)
    @format_proc ? @format_proc.call(*args) : super(*args)
  end

end
