]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
Add $stdout flushing to debug. This is needed to work around some 'laggy console...
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 29 Jun 2006 22:56:08 +0000 (22:56 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 29 Jun 2006 22:56:08 +0000 (22:56 +0000)
lib/rbot/ircbot.rb

index 76820bc90428718c7d0f7501acf0c52674749039..8f0a26469d76f3ef40f7b4bb5de660575f61bbb8 100644 (file)
@@ -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