Redirects all output sent to System.err to ImageJ's log console. @param prefix The prefix string inserted at the start of each output line. Pass null to use the default prefix or an empty string to remove the prefix.
(String prefix)
| 69 | * remove the prefix. |
| 70 | */ |
| 71 | public static void redirectSystemErr(String prefix) { |
| 72 | if (originalSystemErr == null) { // has no effect if System.out is already replaced |
| 73 | originalSystemErr = System.err; // remember the original System.out stream |
| 74 | temporarySystemErr = new LogStream(prefix); |
| 75 | System.setErr(temporarySystemErr); |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * Returns the redirection stream for {@code System.out} if it exists. |