# File lib/rbot/ircbot.rb, line 16 def rawlog(level, message=nil, who_pos=1) call_stack = caller if call_stack.length > who_pos who = call_stack[who_pos].sub(%r{(?:.+)/([^/]+):(\d+)(:in .*)?}) { "#{$1}:#{$2}#{$3}" } else who = "(unknown)" end # Output each line. To distinguish between separate messages and multi-line # messages originating at the same time, we blank #{who} after the first message # is output. message.to_s.each_line { |l| $logger.add(level, l.chomp, who) who.gsub!(/./," ") } end