diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rbot/ircbot.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index 76820bc9..8f0a2646 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -5,8 +5,11 @@ require 'fileutils' $debug = false unless $debug # print +message+ if debugging is enabled def debug(message=nil) - stamp = Time.now.strftime("%Y/%m/%d %H:%M:%S") - print "D: [#{stamp}] #{message}\n" if($debug && message) + if ($debug && message) + stamp = Time.now.strftime("%Y/%m/%d %H:%M:%S") + print "D: [#{stamp}] #{message}\n" + $stdout.flush + end #yield end |