]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
Oops, wrong way to remove the path from the module names; fix it, and provide test...
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Wed, 26 Jul 2006 23:05:55 +0000 (23:05 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Wed, 26 Jul 2006 23:05:55 +0000 (23:05 +0000)
lib/rbot/ircbot.rb

index 7de676b5f28385802f98583f1d8abfeadf08a28b..4df071f835c0a7476913ee9f6ed1d6a2c6a1e765 100644 (file)
@@ -21,7 +21,7 @@ def rawlog(code="", message=nil)
     $stderr.puts "ERROR IN THE LOGGING SYSTEM, THIS CAN'T HAPPEN"
     who = "WTF2??  "
   else
-    who = call_stack[1].match(%r{(?:.+)/([^/]+):(\d+)(?::(in .*))?})[1,3].join(":")
+    who = call_stack[1].sub(%r{(?:.+)/([^/]+):(\d+)(:in .*)?}) { "#{$1}:#{$2}#{$3}" }
   end
   stamp = Time.now.strftime("%Y/%m/%d %H:%M:%S")
   message.to_s.each_line { |l|
@@ -50,6 +50,11 @@ def error(message=nil)
   rawlog("E", message)
 end
 
+debug "debug test"
+log "log test"
+warning "warning test"
+error "error test"
+
 # The following global is used for the improved signal handling.
 $interrupted = 0