summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2006-07-26 23:05:55 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2006-07-26 23:05:55 +0000
commitbec899cdd86308a672399020d0bafb4369f38a4b (patch)
tree3a3d8e81f90b650dc04c336cc02fcd4f379b24a1 /lib
parent9223bcdf64dbcea6eaa7ae352ce5b9a12ff18003 (diff)
Oops, wrong way to remove the path from the module names; fix it, and provide test messages for all logging levels
Diffstat (limited to 'lib')
-rw-r--r--lib/rbot/ircbot.rb7
1 files changed, 6 insertions, 1 deletions
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