System.out.print|ln(..) to null - how?

It’s probably easy to send all System.out.print’s to the Null-device but I can’t remember how…

You’ve to use System.setOut(…) but with what parameter, please?

Btw. is it a bad idea to do this? Critical (=usually application error) messages I always print to the err stream instead of out. All the System.out’s are just verbose but I’d like to avoid them if a parameter is being set…

System.setOut( new PrintStream( new OutputStream() ) );
might do the trick, but i have a sneaking suspicion that some buffer somewhere will fill up because it isn’t being read from, and execution will halt untill the buffer is emptied.

This is exactly the kind of scenario the java.util.logging apis were built for. I haven’t used them myself, but i get the impression they quickly become indispensable once you get used to them.

Edit: wow, after more than a year of daily visits, i finally scrape into being a Junior Member :slight_smile:

http://developer.apple.com/qa/java/java11.html

[quote]http://developer.apple.com/qa/java/java11.html
[/quote]
That’s it. Many thanks.