diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-07-20 19:47:39 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-07-20 19:47:39 +0000 |
commit | da24f0f90c86a399a716d90c645ab921d03c5f51 (patch) | |
tree | c38601d8fdaf38e211d4bf8acbed16738bcba7a4 /lib/rbot/dbhash.rb | |
parent | 485776ce70e37ecfa56740ae02ce11586b8686d9 (diff) |
Rename the former {{{log}}} method to {{{irclog}}} and introduce new logging functions: alongside the old {{{debug}}} function we now have {{{log}}}, {{{warning}}} and {{{error}}}, which should be used everywhere instead of the good old {{{puts}}} method
Diffstat (limited to 'lib/rbot/dbhash.rb')
-rw-r--r-- | lib/rbot/dbhash.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/rbot/dbhash.rb b/lib/rbot/dbhash.rb index 2170ea08..6cae7b2b 100644 --- a/lib/rbot/dbhash.rb +++ b/lib/rbot/dbhash.rb @@ -1,8 +1,8 @@ begin require 'bdb' rescue Exception => e - puts "Got exception: "+e - puts "rbot couldn't load the bdb module, perhaps you need to install it? try: http://www.ruby-lang.org/en/raa-list.rhtml?name=bdb" + error "Got exception: "+e + error "rbot couldn't load the bdb module, perhaps you need to install it? try: http://www.ruby-lang.org/en/raa-list.rhtml?name=bdb" exit 2 end @@ -11,7 +11,7 @@ module BDB class CIBtree < Btree def bdb_bt_compare(a, b) if a == nil || b == nil - debug "CIBTree: WARNING: comparing #{a.inspect} (#{self[a].inspect}) with #{b.inspect} (#{self[b].inspect})" + warning "CIBTree: comparing #{a.inspect} (#{self[a].inspect}) with #{b.inspect} (#{self[b].inspect})" end (a||'').downcase <=> (b||'').downcase end @@ -155,7 +155,7 @@ module Irc debug "DBTree: checking transactions ..." has_active_txn = @@env.txn_stat["st_nactive"] > 0 if has_active_txn - debug "DBTree: WARNING: not all transactions completed!" + warning "DBTree: not all transactions completed!" end DBTree.cleanup_logs debug "DBTree: closing environment #{@@env}" @@ -169,7 +169,7 @@ module Irc BDB::Env.remove("#{path}") end rescue => e - debug "Failed: #{e}" + error "failed to clean up environment: #{e.inspect}" end end |