From bec899cdd86308a672399020d0bafb4369f38a4b Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Wed, 26 Jul 2006 23:05:55 +0000 Subject: [PATCH] Oops, wrong way to remove the path from the module names; fix it, and provide test messages for all logging levels --- lib/rbot/ircbot.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index 7de676b5..4df071f8 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -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 -- 2.39.5