public class IjLogStream extends PrintStream
out
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush() |
static PrintStream |
getCurrentErrStream()
Returns the redirection stream for
System.err if it exists. |
static PrintStream |
getCurrentOutStream()
Returns the redirection stream for
System.out if it exists. |
static void |
redirectSystem()
Redirects all output sent to
System.out and System.err
to ImageJ's log console using empty prefix strings. |
static void |
redirectSystem(String outPrefix,
String errPrefix)
Redirects all output sent to
System.out and System.err
to ImageJ's log console using the default prefixes. |
static void |
redirectSystemErr(String prefix)
Redirects all output sent to
System.err to ImageJ's log console. |
static void |
redirectSystemOut(String prefix)
Redirects all output sent to
System.out to ImageJ's log console. |
static void |
revertSystem()
Use this method to revert both
System.out and System.err
to their original output streams. |
static void |
revertSystemErr()
Use this method to revert
System.err
to the original output stream. |
static void |
revertSystemOut()
Use this method to revert
System.out
to the original output stream. |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
public static void redirectSystem()
System.out
and System.err
to ImageJ's log console using empty prefix strings.
Alternatively use
redirectSystemOut(String)
and redirectSystemErr(String)
to redirect the streams separately and to specify individual prefix strings.public static void redirectSystem(String outPrefix, String errPrefix)
System.out
and System.err
to ImageJ's log console using the default prefixes.outPrefix
- The prefix string inserted at the start of each line sent to System.out
.errPrefix
- The prefix string inserted at the start of each line sent to System.err
.public static void redirectSystemOut(String prefix)
System.out
to ImageJ's log console.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.public static void redirectSystemErr(String prefix)
System.err
to ImageJ's log console.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.public static PrintStream getCurrentOutStream()
System.out
if it exists.
Note that a reference to the current output stream can also be obtained directly from
the System.out
field.PrintStream
object currently substituting System.out
or null
of if System.out
is currently not redirected.public static PrintStream getCurrentErrStream()
System.err
if it exists.
Note that a reference to the current output stream can also be obtained directly from
the System.err
field.PrintStream
object currently substituting System.err
or null
of if System.err
is currently not redirected.public static void revertSystem()
System.out
and System.err
to their original output streams.public static void revertSystemOut()
System.out
to the original output stream.public static void revertSystemErr()
System.err
to the original output stream.public void write(byte[] b)
write
in class FilterOutputStream
public void write(byte[] b, int off, int len)
write
in class PrintStream
public void write(int b)
write
in class PrintStream
public void flush()
flush
in interface Flushable
flush
in class PrintStream
public void close()
close
in interface Closeable
close
in interface AutoCloseable
close
in class PrintStream
Copyright © 2006–2017, Wilhelm Burger, Mark J. Burge (BSD 2-Clause Simplified License)