Package org.eclipse.net4j.util.om.trace
Class ContextTracer
java.lang.Object
org.eclipse.net4j.util.om.trace.ContextTracer
- Direct Known Subclasses:
PerfTracer
- Author:
- Eike Stepper
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Class<?>
getName()
boolean
ifEnabled
(Consumer<ContextTracer> consumer) Provides zero-cost tracing in combination with theassert
keyword.boolean
void
setEnabled
(boolean enabled) toString()
void
void
void
-
Constructor Details
-
ContextTracer
-
-
Method Details
-
getContext
- Since:
- 3.2
-
getBundle
-
getFullName
-
getName
-
getDelegate
-
getParent
-
isEnabled
public boolean isEnabled() -
setEnabled
public void setEnabled(boolean enabled) -
ifEnabled
Provides zero-cost tracing in combination with theassert
keyword.Example:
ContextTracer tracer = ...; assert tracer.ifEnabled(t -> t.format("User %0 logged on", user));
- Returns:
- Always
true
- Since:
- 3.16
-
format
-
format
-
trace
-
trace
-
trace
-
toString
-