summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2006-07-30 07:56:24 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2006-07-30 07:56:24 +0000
commit39c7880d82b5db2163e5c5869b622daceb3477ef (patch)
tree96d0c7e524365bc686ecfa9c7008e4defc65da5d /lib
parent94720bd216fabd41ed894414816d313be68797b6 (diff)
Revert one of the cleanups from [309] that totally hid the information on the origin of logged messages: it should only be blanked out on subsequent lines of multiline messages
Diffstat (limited to 'lib')
-rw-r--r--lib/rbot/ircbot.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb
index 1f11e85f..6226e55e 100644
--- a/lib/rbot/ircbot.rb
+++ b/lib/rbot/ircbot.rb
@@ -17,12 +17,15 @@ 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}" }
- who.gsub!(/./," ")
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