From: Michael Bruschkewitz Date: 2003-02-27T21:59:18+09:00 Subject: Redirecting/Logging output Hello, the following code solves my problem for now, but is there a "nicer" solution? --------------------- SOS -------------------- $logfile = File.new 'log.txt','w' def puts (*args) $defout.puts args; $logfile.puts args end def putc (arg) $defout.putc arg; $logfile.putc arg end def print(*args) $defout.print args; $logfile.print args end def printf (format,a1=nil,a2=nil,a3=nil,a4=nil,a5=nil,a6=nil,a7=nil,a8 =nil) $defout.printf format, a1,a2,a3,a4,a5,a6,a7,a8 $logfile.printf format, a1,a2,a3,a4,a5,a6,a7,a8 end puts Time.new,1,2,3,4; printf "%02x ",127; print 1,2,3; putc 'a' -------------------- EOS ------------------------ Michael B.