1 # Hack BufferedLogger to add timestamps to messages
4 alias_method :old_add, :add
6 def add(severity, message = nil, progname = nil, &block)
7 return if self.level > severity
8 message = (message || (block && block.call) || progname).to_s
10 message = "[%s.%06d #%d] %s" % [time.strftime("%Y-%m-%d %H:%M:%S"), time.usec, $$, message.sub(/^\n+/, "")]
11 old_add(severity, message)