Package zombie.debug
Class DebugLogStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.PrintStream
zombie.debug.DebugLogStream
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDebugLogStream
(PrintStream out, PrintStream warn, PrintStream err, IDebugLogFormatter formatter) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Similar to println.void
Similar to println.void
Similar to println.void
Similar to println.void
Similar to println.void
Similar to println.void
debugln
(String format, Object param0, Object param1, Object param2, Object param3, Object param4, Object param5) Similar to println.void
Prints an object to the Error stream.void
Prints an object to the Error stream, usingString.format(String, Object...)
static String
Returns the class name and method name prefix of the calling code.static String
getStackTraceElementString
(StackTraceElement stackTraceElement, boolean includeLineNo) static String
void
void
void
void
void
void
void
noise
(String format, Object param0, Object param1, Object param2, Object param3, Object param4, Object param5) void
print
(boolean b) Prints a boolean value.void
print
(char c) Prints a character.void
print
(double d) Prints a double-precision floating-point number.void
print
(float f) Prints a floating-point number.void
print
(int i) Prints an integer.void
print
(long l) Prints a long integer.void
Prints an object.void
Prints a string.void
printException
(Throwable ex, String errorMessage, String callerPrefix, LogSeverity severity) void
printException
(Throwable ex, String errorMessage, LogSeverity severity) void
println()
Terminates the current line by writing the line separator string.void
println
(boolean x) Prints a boolean and then terminate the line.void
println
(char x) Prints a character and then terminate the line.void
println
(char[] x) Prints an array of characters and then terminate the line.void
println
(double x) Prints a double and then terminate the line.void
println
(float x) Prints a float and then terminate the line.void
println
(int x) Prints an integer and then terminate the line.void
println
(long x) Prints a long and then terminate the line.void
Prints an Object and then terminate the line.void
Prints a String and then terminate the line.void
void
void
void
void
void
println
(String format, Object param0, Object param1, Object param2, Object param3, Object param4, Object param5) void
println
(String format, Object param0, Object param1, Object param2, Object param3, Object param4, Object param5, Object param6) void
println
(String format, Object param0, Object param1, Object param2, Object param3, Object param4, Object param5, Object param6, Object param7) void
println
(String format, Object param0, Object param1, Object param2, Object param3, Object param4, Object param5, Object param6, Object param7, Object param8) void
void
printStackTrace
(int depth, String message) void
printStackTrace
(String message) void
printUnitTest
(String format, boolean pass, Object... params) void
void
void
void
void
void
void
trace
(String format, Object param0, Object param1, Object param2, Object param3, Object param4, Object param5) static StackTraceElement
tryGetCallerTraceElement
(int depthIdx) void
Prints an object to the Warning stream.void
Prints an object to the Warning stream.Methods inherited from class java.io.PrintStream
append, append, append, checkError, close, flush, format, format, print, printf, write, write, write, writeBytes
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Field Details
-
s_prefixErr
- See Also:
-
s_prefixWarn
- See Also:
-
s_prefixOut
- See Also:
-
s_prefixDebug
- See Also:
-
s_prefixTrace
- See Also:
-
-
Constructor Details
-
DebugLogStream
public DebugLogStream(PrintStream out, PrintStream warn, PrintStream err, IDebugLogFormatter formatter)
-
-
Method Details
-
generateCallerPrefix
Returns the class name and method name prefix of the calling code.- Returns:
-
tryGetCallerTraceElement
-
getStackTraceElementString
public static String getStackTraceElementString(StackTraceElement stackTraceElement, boolean includeLineNo) -
getTopStackTraceString
-
printStackTrace
public void printStackTrace() -
printStackTrace
-
printStackTrace
-
debugln
Similar to println. Prepends the calling method and class name to the output string.- Parameters:
str
-
-
debugln
Similar to println. Prepends the calling method and class name to the output string. UsesString.format(String, Object...)
- Parameters:
format
- The string format to be printed- See Also:
-
debugln
Similar to println. Prepends the calling method and class name to the output string. UsesString.format(String, Object...)
- Parameters:
format
- The string format to be printed- See Also:
-
debugln
Similar to println. Prepends the calling method and class name to the output string. UsesString.format(String, Object...)
- Parameters:
format
- The string format to be printed- See Also:
-
debugln
Similar to println. Prepends the calling method and class name to the output string. UsesString.format(String, Object...)
- Parameters:
format
- The string format to be printed- See Also:
-
debugln
public void debugln(String format, Object param0, Object param1, Object param2, Object param3, Object param4) Similar to println. Prepends the calling method and class name to the output string. UsesString.format(String, Object...)
- Parameters:
format
- The string format to be printed- See Also:
-
debugln
public void debugln(String format, Object param0, Object param1, Object param2, Object param3, Object param4, Object param5) Similar to println. Prepends the calling method and class name to the output string. UsesString.format(String, Object...)
- Parameters:
format
- The string format to be printed- See Also:
-
print
public void print(boolean b) Prints a boolean value. The string produced by
is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of theString.valueOf(boolean)
method.PrintStream.write(int)
- Overrides:
print
in classPrintStream
- Parameters:
b
- Theboolean
to be printed
-
print
public void print(char c) Prints a character. The character is translated into one or more bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the
method.PrintStream.write(int)
- Overrides:
print
in classPrintStream
- Parameters:
c
- Thechar
to be printed
-
print
public void print(int i) Prints an integer. The string produced by
is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of theString.valueOf(int)
method.PrintStream.write(int)
- Overrides:
print
in classPrintStream
- Parameters:
i
- Theint
to be printed- See Also:
-
print
public void print(long l) Prints a long integer. The string produced by
is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of theString.valueOf(long)
method.PrintStream.write(int)
- Overrides:
print
in classPrintStream
- Parameters:
l
- Thelong
to be printed- See Also:
-
print
public void print(float f) Prints a floating-point number. The string produced by
is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of theString.valueOf(float)
method.PrintStream.write(int)
- Overrides:
print
in classPrintStream
- Parameters:
f
- Thefloat
to be printed- See Also:
-
print
public void print(double d) Prints a double-precision floating-point number. The string produced by
is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of theString.valueOf(double)
method.PrintStream.write(int)
- Overrides:
print
in classPrintStream
- Parameters:
d
- Thedouble
to be printed- See Also:
-
print
Prints a string. If the argument isnull
then the string"null"
is printed. Otherwise, the string's characters are converted into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the
method.PrintStream.write(int)
- Overrides:
print
in classPrintStream
- Parameters:
s
- TheString
to be printed
-
print
Prints an object. The string produced by the
method is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of theString.valueOf(Object)
method.PrintStream.write(int)
- Overrides:
print
in classPrintStream
- Parameters:
obj
- TheObject
to be printed- See Also:
-
printf
- Overrides:
printf
in classPrintStream
-
println
public void println()Terminates the current line by writing the line separator string. The line separator string is defined by the system propertyline.separator
, and is not necessarily a single newline character ('\n'
).- Overrides:
println
in classPrintStream
-
println
public void println(boolean x) Prints a boolean and then terminate the line. This method behaves as though it invokes
and thenprint(boolean)
.println()
- Overrides:
println
in classPrintStream
- Parameters:
x
- Theboolean
to be printed
-
println
public void println(char x) Prints a character and then terminate the line. This method behaves as though it invokes
and thenprint(char)
.println()
- Overrides:
println
in classPrintStream
- Parameters:
x
- Thechar
to be printed.
-
println
public void println(int x) Prints an integer and then terminate the line. This method behaves as though it invokes
and thenprint(int)
.println()
- Overrides:
println
in classPrintStream
- Parameters:
x
- Theint
to be printed.
-
println
public void println(long x) Prints a long and then terminate the line. This method behaves as though it invokes
and thenprint(long)
.println()
- Overrides:
println
in classPrintStream
- Parameters:
x
- a Thelong
to be printed.
-
println
public void println(float x) Prints a float and then terminate the line. This method behaves as though it invokes
and thenprint(float)
.println()
- Overrides:
println
in classPrintStream
- Parameters:
x
- Thefloat
to be printed.
-
println
public void println(double x) Prints a double and then terminate the line. This method behaves as though it invokes
and thenprint(double)
.println()
- Overrides:
println
in classPrintStream
- Parameters:
x
- Thedouble
to be printed.
-
println
public void println(char[] x) Prints an array of characters and then terminate the line. This method behaves as though it invokes
and thenprint(char[])
.println()
- Overrides:
println
in classPrintStream
- Parameters:
x
- an array of chars to print.
-
println
Prints a String and then terminate the line. This method behaves as though it invokes
and thenprint(String)
.println()
- Overrides:
println
in classPrintStream
- Parameters:
x
- TheString
to be printed.
-
println
Prints an Object and then terminate the line. This method calls at first String.valueOf(x) to get the printed object's string value, then behaves as though it invokes
and thenprint(String)
.println()
- Overrides:
println
in classPrintStream
- Parameters:
x
- TheObject
to be printed.
-
println
-
println
-
println
-
println
-
println
-
println
-
println
-
println
-
println
-
error
Prints an object to the Error stream. The string produced by the
method is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of theString.valueOf(Object)
method.PrintStream.write(int)
- Parameters:
obj
- TheObject
to be printed- See Also:
-
error
Prints an object to the Error stream, usingString.format(String, Object...)
- Parameters:
format
- The string format to be printedparams
- The list of parameters to be inserted in the string.- See Also:
-
warn
Prints an object to the Warning stream. The string produced by the
method is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of theString.valueOf(Object)
method.PrintStream.write(int)
- Parameters:
obj
- TheObject
to be printed- See Also:
-
warn
Prints an object to the Warning stream. The string produced by the
method is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of theString.valueOf(Object)
method.PrintStream.write(int)
- Parameters:
format
- The string format to be printedparams
- The list of parameters to be inserted in the string.- See Also:
-
printUnitTest
-
printException
-
printException
public void printException(Throwable ex, String errorMessage, String callerPrefix, LogSeverity severity) -
noise
-
noise
-
noise
-
noise
-
noise
-
noise
-
noise
-
trace
-
trace
-
trace
-
trace
-
trace
-
trace
-
trace
-