From: Brian Cowdery Date: 2006-06-16T07:50:42+09:00 Subject: Capturing STDOUT to a Logger I'm using Test::Unit and i want to capture the console messages to a log file - But im already using Logger to capture custom assertions, messages etc. The problem with Logger as it is is that if an error occurs in the script it doesn't capture it as it will only grab things explicitly sent to the logger (using Logger.info Logger.log etc.), and not normal messages (puts, print etc.) Is there a way that i can grab STDOUT and pipe it THROUGH the Logger? I was thinking about putting a listener on the STDOUT stream that when a line was writen out (through puts or print) could buffer it then call Logger.info to write it out to the log file... I'm preaty new to Ruby so i don't even know if this is possible - Any ideas? -- Posted via http://www.ruby-forum.com/.