diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-07-27 08:51:48 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-07-27 08:51:48 +0000 |
commit | 67017561299dc4fbd4f9ebfafc112d9157904469 (patch) | |
tree | 2f1e1b4d882b1fb994f7b6ba5c8f231ab387826c /bin | |
parent | 19bfab8e4d4da150d07d8b03fdf922a7385b1509 (diff) |
Revamped logging system based on the Logger class from stdlib
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/rbot | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -35,11 +35,12 @@ $opts = Hash.new orig_opts = ARGV.dup opts = GetoptLong.new( + ["--background", "-b", GetoptLong::NO_ARGUMENT], ["--debug", "-d", GetoptLong::NO_ARGUMENT], ["--help", "-h", GetoptLong::NO_ARGUMENT], + ["--loglevel", "-l", GetoptLong::REQUIRED_ARGUMENT], ["--trace", "-t", GetoptLong::REQUIRED_ARGUMENT], - ["--version", "-v", GetoptLong::NO_ARGUMENT], - ["--background", "-b", GetoptLong::NO_ARGUMENT] + ["--version", "-v", GetoptLong::NO_ARGUMENT] ) $debug = false @@ -51,6 +52,8 @@ opts.each {|opt, arg| $opts[opt.sub(/^-+/, "")] = arg } +$cl_loglevel = $opts["loglevel"] + if ($opts["trace"]) set_trace_func proc { |event, file, line, id, binding, classname| if classname.to_s == $opts["trace"] |