Class DebugLogStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.PrintStream
zombie.debug.DebugLogStream
- All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable
-
Constructor Summary
ConstructorsConstructorDescriptionDebugLogStream(PrintStream out, PrintStream warn, PrintStream err, DebugType debugType) DebugLogStream(PrintStream out, PrintStream warn, PrintStream err, LogSeverity logSeverity) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddebuglnWithTraceOffset(int backTraceOffset, Object format, Object... params) voiddebugOnceln(Object format, Object... params) voiddebugOncelnWithTraceOffset(int backTraceOffset, Object format, Object... params) voidvoiderrorWithTraceOffset(int backTraceOffset, Object format, Object... params) static StringReturns the class name and method name prefix of the calling code.static StringgetStackTraceElementString(StackTraceElement[] stackTraceElements, int atIDx, boolean includeLogTraceFileLocation) static StringbooleanbooleanisLogEnabled(LogSeverity logSeverity) voidvoidnoiseWithTraceOffset(int backTraceOffset, Object format, Object... params) voidprint(boolean b) Prints a boolean value.voidprint(char c) Prints a character.voidprint(double d) Prints a double-precision floating-point number.voidprint(float f) Prints a floating-point number.voidprint(int i) Prints an integer.voidprint(long l) Prints a long integer.voidPrints an object.voidPrints a string.voidprintException(Throwable ex, String errorMessage, String callerPrefix, LogSeverity severity) voidprintException(Throwable ex, String errorMessage, LogSeverity severity) voidprintException(Throwable ex, LogSeverity severity, String callerPrefix, String errorMessageFormat, Object... params) voidprintln()Terminates the current line by writing the line separator string.voidprintln(boolean x) Prints a boolean and then terminate the line.voidprintln(char x) Prints a character and then terminate the line.voidprintln(char[] x) Prints a character and then terminate the line.voidprintln(double x) Prints a double and then terminate the line.voidprintln(float x) Prints a float and then terminate the line.voidprintln(int x) Prints an integer and then terminate the line.voidprintln(long x) Prints a long and then terminate the line.voidPrints an Object and then terminate the line.voidvoidPrints a String and then terminate the line.voidprintStackTrace(LogSeverity severity, int depthStart, int depthCount, String messageFormat, Object... params) voidsetLogSeverity(LogSeverity newSeverity) voidvoidtraceWithTraceOffset(int backTraceOffset, Object format, Object... params) voidvoidvoidwarnOnceWithTraceOffset(int backTraceOffset, Object format, Object... params) voidwarnWithTraceOffset(int backTraceOffset, Object format, Object... params) Methods inherited from class PrintStream
append, append, append, charset, checkError, close, flush, format, format, print, printf, write, write, write, writeBytesMethods inherited from class OutputStream
nullOutputStream
-
Constructor Details
-
DebugLogStream
-
DebugLogStream
-
-
Method Details
-
setLogSeverity
-
getDebugType
-
getLogSeverity
-
getWrappedOutStream
-
getWrappedWarnStream
-
getWrappedErrStream
-
getFormatter
-
generateCallerPrefix
Returns the class name and method name prefix of the calling code. -
getStackTraceElementString
public static String getStackTraceElementString(StackTraceElement[] stackTraceElements, int atIDx, boolean includeLogTraceFileLocation) -
getTopStackTraceString
-
printStackTrace
public void printStackTrace(LogSeverity severity, int depthStart, int depthCount, String messageFormat, Object... params) -
isEnabled
public boolean isEnabled() -
isLogEnabled
-
trace
-
debugln
-
debugOnceln
-
noise
-
warn
-
warnOnce
-
error
-
debuglnWithTraceOffset
-
debugOncelnWithTraceOffset
-
noiseWithTraceOffset
-
warnWithTraceOffset
-
errorWithTraceOffset
-
traceWithTraceOffset
-
warnOnceWithTraceOffset
-
print
public void print(boolean b) Prints a boolean value. The string produced by String.valueOf(boolean) is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the PrintStream.write(int) method.- Overrides:
printin classPrintStream- Parameters:
b- The boolean 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 PrintStream.write(int) method.- Overrides:
printin classPrintStream- Parameters:
c- The char to be printed
-
print
public void print(int i) Prints an integer. The string produced by String.valueOf(int) is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the PrintStream.write(int) method.- Overrides:
printin classPrintStream- Parameters:
i- The int to be printed
-
print
public void print(long l) Prints a long integer. The string produced by String.valueOf(long) is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the PrintStream.write(int) method.- Overrides:
printin classPrintStream- Parameters:
l- The long to be printed
-
print
public void print(float f) Prints a floating-point number. The string produced by String.valueOf(float) is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the PrintStream.write(int) method.- Overrides:
printin classPrintStream- Parameters:
f- The float to be printed
-
print
public void print(double d) Prints a double-precision floating-point number. The string produced by String.valueOf(double) is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the PrintStream.write(int) method.- Overrides:
printin classPrintStream- Parameters:
d- The double to be printed
-
print
Prints a string. If the argument is null 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 PrintStream.write(int) method.- Overrides:
printin classPrintStream- Parameters:
s- The String to be printed
-
print
Prints an object. The string produced by the String.valueOf(Object) method is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the PrintStream.write(int) method.- Overrides:
printin classPrintStream- Parameters:
obj- The Object to be printed
-
printf
- Overrides:
printfin classPrintStream
-
println
public void println()Terminates the current line by writing the line separator string. The line separator string is defined by the system property line.separator, and is not necessarily a single newline character ('\n').- Overrides:
printlnin classPrintStream
-
println
public void println(boolean x) Prints a boolean and then terminate the line. This method behaves as though it invokes print(boolean) and then println().- Overrides:
printlnin classPrintStream- Parameters:
x- The boolean to be printed
-
println
public void println(char x) Prints a character and then terminate the line. This method behaves as though it invokes print(char) and then println().- Overrides:
printlnin classPrintStream- Parameters:
x- The char to be printed.
-
println
public void println(int x) Prints an integer and then terminate the line. This method behaves as though it invokes print(int) and then println().- Overrides:
printlnin classPrintStream- Parameters:
x- The int to be printed.
-
println
public void println(long x) Prints a long and then terminate the line. This method behaves as though it invokes print(long) and then println().- Overrides:
printlnin classPrintStream- Parameters:
x- a The long to be printed.
-
println
public void println(float x) Prints a float and then terminate the line. This method behaves as though it invokes print(float) and then println().- Overrides:
printlnin classPrintStream- Parameters:
x- The float to be printed.
-
println
public void println(double x) Prints a double and then terminate the line. This method behaves as though it invokes print(double) and then println().- Overrides:
printlnin classPrintStream- Parameters:
x- The double to be printed.
-
println
public void println(char[] x) Prints a character and then terminate the line. This method behaves as though it invokes print(char) and then println().- Overrides:
printlnin classPrintStream- Parameters:
x- The char to be printed.
-
println
Prints a String and then terminate the line. This method behaves as though it invokes print(String) and then println().- Overrides:
printlnin classPrintStream- Parameters:
x- The String 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 print(String) and then println().- Overrides:
printlnin classPrintStream- Parameters:
x- The Object to be printed.
-
println
-
printException
-
printException
public void printException(Throwable ex, String errorMessage, String callerPrefix, LogSeverity severity) -
printException
public void printException(Throwable ex, LogSeverity severity, String callerPrefix, String errorMessageFormat, Object... params)
-