]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
Improve debugging output in messagemapper
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 31 Aug 2006 15:12:02 +0000 (15:12 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 31 Aug 2006 15:12:02 +0000 (15:12 +0000)
lib/rbot/messagemapper.rb

index e899770a79abb5072f66336db0457d10819da485..5e1e01a8cd7e9c31bea1d850a25e3d2668c47e5f 100644 (file)
@@ -305,8 +305,9 @@ module Irc
       return nil, "#{m.message.inspect} doesn't match #{@dyn_items.first.inspect} (#{@regexp})" unless matching
       return nil, "#{m.message.inspect} only matches #{@dyn_items.first.inspect} (#{@regexp}) partially" unless matching[0] == m.message
 
-      debug "#{m.message.inspect} matched #{@regexp} with #{matching[1..-1].join(', ')}"
-      debug "Associating #{matching[1..-1].join(', ')} with dyn items #{@dyn_items[1..-1].join(', ')}"
+      debug_match = matching[1..-1].collect{ |m| m.inspect}.join(', ')
+      debug "#{m.message.inspect} matched #{@regexp} with #{debug_match}"
+      debug "Associating #{debug_match} with dyn items #{@dyn_items[1..-1].join(', ')}"
 
       (@dyn_items.length - 1).downto 1 do |i|
         it = @dyn_items[i]