From 8caeee3853ef66dd0e326ff17906f9ca544b8a35 Mon Sep 17 00:00:00 2001 From: Tom Gilbert Date: Thu, 28 Jul 2005 23:55:59 +0000 Subject: Thu Jul 28 23:45:26 BST 2005 Tom Gilbert * Reworked the Timer module. The Timer now has a smart thread manager to start/stop the tick() thread. This means the timer isn't called every 0.1 seconds to see what needs doing, which is much more efficient * reworked the ircsocket queue mechanism to use a Timer * reworked the nickserv plugin to use maps * made server.reconnect_wait configurable * added Class tracing mechanism to bin/rbot, use --trace Classname for debugging --- bin/rbot | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/rbot b/bin/rbot index 962f3d0d..f65cb949 100755 --- a/bin/rbot +++ b/bin/rbot @@ -35,7 +35,7 @@ rescue LoadError => e exit 2 end -$debug = true +$debug = false $version="0.9.8" $opts = Hash.new @@ -47,7 +47,8 @@ end opts = GetoptLong.new( ["--debug", "-d", GetoptLong::NO_ARGUMENT], - ["--help", "-h", GetoptLong::OPTIONAL_ARGUMENT], + ["--help", "-h", GetoptLong::NO_ARGUMENT], + ["--trace", "-t", GetoptLong::REQUIRED_ARGUMENT], ["--version", "-v", GetoptLong::NO_ARGUMENT] ) @@ -56,6 +57,15 @@ opts.each {|opt, arg| $opts[opt.sub(/^-+/, "")] = arg } +if ($opts["trace"]) + set_trace_func proc { |event, file, line, id, binding, classname| + if classname.to_s == $opts["trace"] + printf "TRACE: %8s %s:%-2d %10s %8s\n", event, File.basename(file), line, id, classname + end + } +end + + if ($opts["version"]) puts "rbot #{$version}" exit 0 -- cgit v1.2.3