public class LogConsole
extends java.io.PrintStream
implements java.io.Serializable
LogWriter
that captures System.out
and
System.err
output and redirects the output to the MAIN log using the
LogWriter.DEBUG
severity level.
The LogWriter.init
method optionally creates an instance of this
class, depending on the boolean
value passed to the method. Other
classes should not reference this class or any of its methods.
Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID
The class' serialization version id.
|
Constructor and Description |
---|
LogConsole()
Constructs a new instance of the console logger.
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkError()
Flushes this output stream and checks its error state.
|
void |
close()
Closes this output stream and releases any system resources associated
with this stream.
|
void |
flush()
Flushes this output stream and forces any buffered output bytes to be
written out.
|
private void |
log(java.lang.String s)
Logs a string to the MAIN log using
LogWriter.DEBUG severity. |
void |
print(boolean b)
Logs a boolean value.
|
void |
print(char c)
Logs a character value.
|
void |
print(char[] s)
Logs a character array value.
|
void |
print(double d)
Logs a double value.
|
void |
print(float f)
Logs a float value.
|
void |
print(int i)
Logs an integer value.
|
void |
print(long l)
Logs a long value.
|
void |
print(java.lang.Object obj)
Logs an object value.
|
void |
print(java.lang.String s)
Logs a string value.
|
void |
println(boolean x)
Logs a boolean value.
|
void |
println(char x)
Logs a character value.
|
void |
println(char[] x)
Logs a character array value.
|
void |
println(double x)
Logs a double value.
|
void |
println(float x)
Logs a float value.
|
void |
println(int x)
Logs an integer value.
|
void |
println(long x)
Logs a long value.
|
void |
println(java.lang.Object x)
Logs an object value.
|
void |
println(java.lang.String x)
Logs a string value.
|
void |
write(byte[] b,
int off,
int len)
Logs a subset of a byte array.
|
void |
write(int b)
Logs a byte value.
|
private static final long serialVersionUID
public LogConsole()
System.out
output stream and the System.err
output stream to
this class.private void log(java.lang.String s)
LogWriter.DEBUG
severity.s
- (String) The string to log.public boolean checkError()
close()
in PrintStream
. This implementation
always returns false
.checkError
in class java.io.PrintStream
false
.public void close()
close()
in PrintStream
. This implementation
does nothing.close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.PrintStream
public void flush()
flush()
in PrintStream
. This implementation
does nothing.flush
in interface java.io.Flushable
flush
in class java.io.PrintStream
public void print(boolean b)
print(boolean b)
in PrintStream
.print
in class java.io.PrintStream
b
- (boolean) The boolean to log.public void print(char c)
print(char c)
in PrintStream
.print
in class java.io.PrintStream
c
- (char) The character to log.public void print(char[] s)
print(char s[])
in PrintStream
.print
in class java.io.PrintStream
s
- (char[]) The character array to log.public void print(double d)
print(double d)
in PrintStream
.print
in class java.io.PrintStream
d
- (double) The double to log.public void print(float f)
print(float f)
in PrintStream
.print
in class java.io.PrintStream
f
- (float) The float to log.public void print(int i)
print(int i)
in PrintStream
.print
in class java.io.PrintStream
i
- (int) The integer to log.public void print(long l)
print(long l)
in PrintStream
.print
in class java.io.PrintStream
l
- (long) The long to log.public void print(java.lang.Object obj)
print(Object obj)
in PrintStream
.print
in class java.io.PrintStream
obj
- (Object) The object to log.public void print(java.lang.String s)
print(String s)
in PrintStream
.print
in class java.io.PrintStream
s
- (String) The string to log.public void println(boolean x)
println(boolean x)
in PrintStream
.println
in class java.io.PrintStream
x
- (boolean) The boolean to log.public void println(char x)
println(char x)
in PrintStream
.println
in class java.io.PrintStream
x
- (char) The character to log.public void println(char[] x)
println(char x[])
in PrintStream
.println
in class java.io.PrintStream
x
- (char[]) The character array to log.public void println(double x)
println(double x)
in PrintStream
.println
in class java.io.PrintStream
x
- (double) The double to log.public void println(float x)
println(float x)
in PrintStream
.println
in class java.io.PrintStream
x
- (float) The float to log.public void println(int x)
println(int x)
in PrintStream
.println
in class java.io.PrintStream
x
- (int) The integer to log.public void println(long x)
println(long x)
in PrintStream
.println
in class java.io.PrintStream
x
- (long) The long to log.public void println(java.lang.Object x)
println(Object x)
in PrintStream
.println
in class java.io.PrintStream
x
- (Object) The object to log.public void println(java.lang.String x)
println(String x)
in PrintStream
.println
in class java.io.PrintStream
x
- (String) The string to log.public void write(int b)
write(int b)
in PrintStream
.write
in class java.io.PrintStream
b
- (int) The byte to log.public void write(byte[] b, int off, int len)
write(byte[] b, int off, int len)
in PrintStream
.write
in class java.io.PrintStream
b
- (byte[]) The byte array containing the subset to to log.off
- (int) The first position of the subset.len
- (int) The length of the subset.