Re: Using System.out and System.err from ImageJ plugins (Java)
Posted by
Rasband, Wayne (NIH/NIMH) [E] on
URL: http://imagej.273.s1.nabble.com/Using-System-out-and-System-err-from-ImageJ-plugins-Java-tp5001799p5001901.html
On Feb 18, 2013, at 7:46 AM, Burger Wilhelm wrote:
> Hello all,
>
> I would like to share a piece of Java code for ImageJ that I wrote out of need and perhaps others might find useful too:
>
> This small library facilitates the redirection of output to System.out and System.err to the ImageJ Log-console. Typically in ImageJ output sent to the standard system streams by calls such as System.out.println(...) are suppressed. Redirecting the standard output streams makes this output appear in ImageJ's log console, analogous to using the IJ.log() method. This is particularly useful for debugging imported code and for writing classes that are independent of ImageJ.
>
> More details and the complete code with examples can be found here:
>
http://staff.fh-hagenberg.at/burger/imagej/index.html>
> Comments and suggestions for improvements are welcome.
This library is built into the ImageJ 1.47m daily build as the ij.io.LogStream class. You can redirect System.out and System.err messages to the Log window by enabling debug mode in Edit>Options>Misc.
-wayne
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html