I’m writing a Java class which plugs into a larger framework. Somewhere upstream, the code is redirecting System.out to somewhere other than standard out, but I really want to print a debugging message to standard out. Is there a way for me to get a hook back into standard out?
I’m writing a Java class which plugs into a larger framework. Somewhere upstream, the
Share
Why not use
System.err?The most straightforward solution I see is just store
System.outsomewhere in your class before calling the library.After looking around a bit, you should be able to use
System.console().printf(...).