public class Trace extends Object
Constructor and Description |
---|
Trace()
Create an empty trace with level set to 0 (no tracing)
|
Trace(int level)
Create an empty trace with given level.
|
Modifier and Type | Method and Description |
---|---|
Trace |
clear()
Remove all trace information and set the trace level to 0.
|
int |
getLevel()
Returns the trace level.
|
TraceNode |
getRoot()
Returns the root of the trace tree.
|
Trace |
setLevel(int level)
Set the trace level.
|
boolean |
shouldTrace(int level)
Check if information with the given level should be traced.
|
Trace |
swap(Trace other)
Swap the internals of this with another.
|
String |
toString() |
boolean |
trace(int level,
String note)
Add the given note to the trace information if tracing is enabled for the given level.
|
boolean |
trace(int level,
String note,
boolean addTime)
Add the given note to the trace information if tracing is enabled for the given level.
|
public Trace()
public Trace(int level)
level
- Level to set.public Trace clear()
public Trace swap(Trace other)
other
- The trace to swap internals with.public Trace setLevel(int level)
level
- The level to set.public int getLevel()
public boolean shouldTrace(int level)
level
- The trace level to test.public boolean trace(int level, String note)
level
- The trace level of the note.note
- The note to add.public boolean trace(int level, String note, boolean addTime)
level
- The trace level of the note.note
- The note to add.addTime
- Whether or not to prefix note with a timestamp.public TraceNode getRoot()
Copyright © 2018. All rights reserved.