| Modifier and Type | Field and Description |
|---|---|
| private static final ThreadLocal | logs
Thread <-> CaptureLog associations. |
| private final PrintStream | out
Wrapped PrintStream.
|
| private static final Queue | reuse
Spare CaptureLog ready for reuse. |
| Access | Constructor and Description |
|---|---|
| public | SystemLogHandler(PrintStream
The stream to capture wrapped)Construct the handler to capture the output of the given steam. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | checkError()
Overrides java. Flushes the stream if it's not closed and checks its error state. |
| public void | |
| protected PrintStream | |
| public void | |
| public void | print(boolean
The b)boolean to be printedOverrides java. Prints a boolean value. |
| public void | |
| public void | |
| public void | |
| public void | print(float
The f)float to be printedOverrides java. Prints a floating-point number. |
| public void | print(double
The d)double to be printedOverrides java. Prints a double-precision floating-point number. |
| public void | print(char[]
The array of chars to be printed s)Overrides java. Prints an array of characters. |
| public void | |
| public void | |
| public void | println()
Overrides java. Terminates the current line by writing the line separator string. |
| public void | println(boolean
The x)boolean to be printedOverrides java. Prints a boolean and then terminates the line. |
| public void | println(char
The x)char to be printed.Overrides java. Prints a character and then terminates the line. |
| public void | println(int
The x)int to be printed.Overrides java. Prints an integer and then terminates the line. |
| public void | println(long
a The x)long to be printed.Overrides java. Prints a long and then terminates the line. |
| public void | println(float
The x)float to be printed.Overrides java. Prints a float and then terminates the line. |
| public void | println(double
The x)double to be printed.Overrides java. Prints a double and then terminates the line. |
| public void | println(char[]
an array of chars to print. x)Overrides java. Prints an array of characters and then terminates the line. |
| public void | println(String
The x)String to be printed.Overrides java. Prints a String and then terminates the line. |
| public void | println(Object
The x)Object to be printed.Overrides java. Prints an Object and then terminates the line. |
| protected void | |
| public static void | |
| public static String | |
| public void | write(int
The byte to be written b)Overrides java. Writes the specified byte to this stream. |
| public void | write(byte[]
A byte array b)Overrides java. Writes all bytes from the specified byte array to this stream. |
| public void | write(byte[]
A byte array buf, int Offset from which to start taking bytes off, int Number of bytes to write len)Overrides java. Writes |
| logs | back to summary |
|---|---|
| private static final ThreadLocal<Deque<CaptureLog>> logs Thread <-> CaptureLog associations. | |
| out | back to summary |
|---|---|
| private final PrintStream out Hides java. Wrapped PrintStream. | |
| reuse | back to summary |
|---|---|
| private static final Queue<CaptureLog> reuse Spare CaptureLog ready for reuse. | |
| SystemLogHandler | back to summary |
|---|---|
| public SystemLogHandler(PrintStream wrapped) Construct the handler to capture the output of the given steam.
| |
| checkError | back to summary |
|---|---|
| public boolean checkError() Overrides java. Doc from java. Flushes the stream if it's not closed and checks its error state.
| |
| close | back to summary |
|---|---|
| public void close() Overrides java. Implements java. Doc from java. Closes the stream. This is done by flushing the stream and then closing the underlying output stream.
| |
| findStream | back to summary |
|---|---|
| protected PrintStream findStream() Find PrintStream to which the output must be written to.
| |
| flush | back to summary |
|---|---|
| public void flush() Overrides java. Implements java. Doc from java. Flushes the stream. This is done by writing any buffered output bytes to the underlying output stream and then flushing that stream.
| |
| back to summary | |
|---|---|
| public void print(boolean b) Overrides java. Doc from java. Prints a boolean value. The string produced by
| |
| back to summary | |
|---|---|
| public void print(char c) Overrides java. Doc from java. Prints a character. The character is translated into one or more bytes
according to the character encoding given to the constructor, or the
default charset if none specified. These bytes
are written in exactly the manner of the
| |
| back to summary | |
|---|---|
| public void print(int i) Overrides java. Doc from java. Prints an integer. The string produced by
| |
| back to summary | |
|---|---|
| public void print(long l) Overrides java. Doc from java. Prints a long integer. The string produced by
| |
| back to summary | |
|---|---|
| public void print(float f) Overrides java. Doc from java. Prints a floating-point number. The string produced by
| |
| back to summary | |
|---|---|
| public void print(double d) Overrides java. Doc from java. Prints a double-precision floating-point number. The string produced by
| |
| back to summary | |
|---|---|
| public void print(char[] s) Overrides java. Doc from java. Prints an array of characters. The characters are converted into bytes
according to the character encoding given to the constructor, or the
default charset if none specified. These bytes
are written in exactly the manner of the
| |
| back to summary | |
|---|---|
| public void print(String s) Overrides java. Doc from java. Prints a string. If the argument is | |
| back to summary | |
|---|---|
| public void print(Object obj) Overrides java. Doc from java. Prints an object. The string produced by the | |
| println | back to summary |
|---|---|
| public void println() Overrides java. Doc from java. Terminates the current line by writing the line separator string. The
line separator string is defined by the system property
| |
| println | back to summary |
|---|---|
| public void println(boolean x) Overrides java. Doc from java. Prints a boolean and then terminates the line. This method behaves as
though it invokes
| |
| println | back to summary |
|---|---|
| public void println(char x) Overrides java. Doc from java. Prints a character and then terminates the line. This method behaves as
though it invokes
| |
| println | back to summary |
|---|---|
| public void println(int x) Overrides java. Doc from java. Prints an integer and then terminates the line. This method behaves as
though it invokes
| |
| println | back to summary |
|---|---|
| public void println(long x) Overrides java. Doc from java. Prints a long and then terminates the line. This method behaves as
though it invokes
| |
| println | back to summary |
|---|---|
| public void println(float x) Overrides java. Doc from java. Prints a float and then terminates the line. This method behaves as
though it invokes
| |
| println | back to summary |
|---|---|
| public void println(double x) Overrides java. Doc from java. Prints a double and then terminates the line. This method behaves as
though it invokes
| |
| println | back to summary |
|---|---|
| public void println(char[] x) Overrides java. Doc from java. Prints an array of characters and then terminates the line. This method
behaves as though it invokes
| |
| println | back to summary |
|---|---|
| public void println(String x) Overrides java. Doc from java. Prints a String and then terminates the line. This method behaves as
though it invokes | |
| println | back to summary |
|---|---|
| public void println(Object x) Overrides java. Doc from java. Prints an Object and then terminates the line. This method calls
at first String.valueOf(x) to get the printed object's string value,
then behaves as
though it invokes | |
| setError | back to summary |
|---|---|
| protected void setError() Overrides java. Doc from java. Sets the error state of the stream to This method will cause subsequent invocations of
| |
| startCapture | back to summary |
|---|---|
| public static void startCapture() Start capturing thread's output. | |
| stopCapture | back to summary |
|---|---|
| public static String stopCapture() Stop capturing thread's output.
| |
| write | back to summary |
|---|---|
| public void write(int b) Overrides java. Doc from java. Writes the specified byte to this stream. If the byte is a newline and
automatic flushing is enabled then the Note that the byte is written as given; to write a character that
will be translated according to the default charset, use the
| |
| write | back to summary |
|---|---|
| public void write(byte[] b) throws IOException Overrides java. Doc from java. Writes all bytes from the specified byte array to this stream. If
automatic flushing is enabled then the Note that the bytes will be written as given; to write characters
that will be translated according to the default charset, use the
| |
| write | back to summary |
|---|---|
| public void write(byte[] buf, int off, int len) Overrides java. Doc from java. Writes Note that the bytes will be written as given; to write characters
that will be translated according to the default charset, use the
| |