public final class Debug
extends java.lang.Object
Has different display statuses :
note: only DEBUG
is
hidden if enable()
is not used. all the others statuses are displayed in the System.out
note: if PrettyPrint
is implemented by the object, it will use PrettyPrint.toPrettyString()
instead of Object.toString()
enable()
,
disable()
,
print(Object,
int)
,
print(PrettyPrint,
int)
,
print(String,
Object, int)
,
print(String,
PrettyPrint, int)
,
println(Object,
int)
,
println(PrettyPrint,
int)
,
(Object,
int)
,
println(String,
PrettyPrint, int)
,
displayTitle()
,
printTitle(String,
int)
,
stack(char)
,
stack(char,
String)
,
unstack()
,
indent(String)
,
now()
Modifier and Type | Field and Description |
---|---|
static int |
DEBUG
|
static int |
ERROR
|
static int |
INFO
|
static int |
WARNING
|
Constructor and Description |
---|
Debug()
|
Modifier and Type | Method and Description |
---|---|
static void |
disable()
Disables any display done with this class.
|
static void |
displayTitle()
Displays the current methodName name (will display it even if
TraceMethod.displayTitle()
is false |
static void |
enable()
Enables
DEBUG
statuses to be displayed.
|
static java.lang.String |
indent(java.lang.String multiline)
Indents the multiline String by one tabulation foreach
|
static java.lang.String |
now()
|
static void |
print(java.lang.Object o,
int status)
Displays the object (uses o.toString())
|
static void |
print(PrettyPrint o,
int status)
Displays the object if it has
PrettyPrint
implemented.
|
static void |
print(java.lang.String name,
java.lang.Object o,
int status)
Displays the object (uses o.toString())
|
static void |
print(java.lang.String name,
PrettyPrint o,
int status)
Displays the object if it has
PrettyPrint
implemented.
|
static void |
println(java.lang.Object o,
int status)
Displays the object (uses o.toString())
|
static void |
println(PrettyPrint o,
int status)
Displays the object if it has
PrettyPrint
implemented.
|
static void |
println(java.lang.String name,
java.lang.Object o,
int status)
Displays the object (uses o.toString())
|
static void |
println(java.lang.String name,
PrettyPrint o,
int status)
Displays the object if it has
PrettyPrint
implemented.
|
static void |
printTitle(java.lang.String title,
int status)
Displays a custom title in the given status
|
static void |
stack(char letter)
Adds a custom stack.
|
static void |
stack(char letter,
java.lang.String title)
Adds a custom stack.
|
static void |
unstack()
Unstacks the last custom stack
Only unstacks custom stacks, even if more method symbols are added after them
|
public static final int DEBUG
public static final int INFO
public static final int WARNING
public static final int ERROR
public static void print(java.lang.Object o, int status)
o
- the object to PrettyPrintstatus
- status of the textpublic static void print(PrettyPrint o, int status)
PrettyPrint
implemented. (uses o.toPrettyString())
o
- the object to PrettyPrintstatus
- status of the textpublic static void println(java.lang.Object o, int status)
o
- the object to PrettyPrintstatus
- status of the textpublic static void println(PrettyPrint o, int status)
PrettyPrint
implemented. (uses o.toPrettyString())
o
- the object to PrettyPrintstatus
- status of the textpublic static void print(java.lang.String name, java.lang.Object o, int status)
name
- name of the objecto
- the object to PrettyPrintstatus
- status of the textpublic static void print(java.lang.String name, PrettyPrint o, int status)
PrettyPrint
implemented. (uses o.toPrettyString())
name
- name of the objecto
- the object to PrettyPrintstatus
- status of the textpublic static void println(java.lang.String name, java.lang.Object o, int status)
name
- name of the objecto
- Object to displaypublic static void println(java.lang.String name, PrettyPrint o, int status)
PrettyPrint
implemented. (uses o.toPrettyString())
name
- name of the objecto
- the object to PrettyPrintstatus
- status of the textpublic static void printTitle(java.lang.String title, int status)
title
- text to displaystatus
- status of the titlepublic static java.lang.String now()
public static void enable()
DEBUG
statuses to be displayed.
public static void disable()
public static void stack(char letter)
unstack()
to unstack them.
letter
- Symbol of the stackpublic static void stack(char letter, java.lang.String title)
unstack()
to unstack them.
letter
- Symbol of the stacktitle
- Title of the stackpublic static void unstack()
Only unstacks custom stacks, even if more method symbols are added after them
public static void displayTitle()
TraceMethod.displayTitle()
is falsepublic static java.lang.String indent(java.lang.String multiline)
multiline
- text to be indented