public final class Debug
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static DebugLevel |
debugLevel
Actual debug level
|
private static java.util.concurrent.locks.ReentrantLock |
REENTRANT_LOCK
For synchronize the printing (To be thread safe)
|
Modifier | Constructor and Description |
---|---|
private |
Debug()
To avoid instance
|
Modifier and Type | Method and Description |
---|---|
static DebugLevel |
getDebugLevel()
Actual debug level
|
static void |
printCalledFrom(DebugLevel debugLevel)
Print information to know which part of code, called a method.
|
static void |
printError(java.lang.Error error,
java.lang.Object... message)
Print an error with its trace
|
static void |
printException(java.lang.Exception exception,
java.lang.Object... message)
Print an exception with its trace
|
private static void |
printInteger(int integer,
int characterNumber)
Print an integer
|
static void |
println(DebugLevel debugLevel,
java.lang.Object... message)
Print some information
|
static void |
printMark(DebugLevel debugLevel,
java.lang.String mark)
Print a mark
|
private static void |
printMessage(DebugLevel debugLevel,
java.lang.StackTraceElement stackTraceElement,
java.lang.Object... message)
Print a message
|
private static void |
printObject(java.lang.Object object)
Print an object
|
static void |
printTodo(java.lang.Object... message)
Print a to do message
|
static void |
printTrace(DebugLevel debugLevel,
java.lang.Object... message)
Print an informative trace (To know the execution stack)
|
private static void |
printTrace(DebugLevel debugLevel,
java.lang.Throwable throwable,
int start)
Print a trace
|
static void |
setDebugLevel(DebugLevel debugLevel)
Change debug level
|
private static DebugLevel debugLevel
private static final java.util.concurrent.locks.ReentrantLock REENTRANT_LOCK
private static void printInteger(int integer, int characterNumber)
integer
- Integer to printcharacterNumber
- Number of character must showprivate static void printMessage(DebugLevel debugLevel, java.lang.StackTraceElement stackTraceElement, java.lang.Object... message)
debugLevel
- Debug levelstackTraceElement
- Trace of the sourcemessage
- Message to printprivate static void printObject(java.lang.Object object)
object
- Object to printprivate static void printTrace(DebugLevel debugLevel, java.lang.Throwable throwable, int start)
debugLevel
- Debug levelthrowable
- Trace to printstart
- Offset to start reading the tracepublic static DebugLevel getDebugLevel()
public static void printCalledFrom(DebugLevel debugLevel)
printTrace(DebugLevel, Object...)
debugLevel
- Debug levelpublic static void printError(java.lang.Error error, java.lang.Object... message)
error
- Error to printmessage
- Message informationpublic static void printException(java.lang.Exception exception, java.lang.Object... message)
exception
- Exception to printmessage
- Message informationpublic static void println(DebugLevel debugLevel, java.lang.Object... message)
debugLevel
- Debug levelmessage
- Message to printpublic static void printMark(DebugLevel debugLevel, java.lang.String mark)
debugLevel
- Debug levelmark
- Mark to printpublic static void printTodo(java.lang.Object... message)
message
- Message to printpublic static void printTrace(DebugLevel debugLevel, java.lang.Object... message)
debugLevel
- Debug levelmessage
- Message to printpublic static void setDebugLevel(DebugLevel debugLevel)
debugLevel
- New debug level