-
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
ActiveTraceImpl,NoOpActiveTrace
public interface ActiveTrace extends AutoCloseable
AnActiveTraceis a short-lived delegate that represents an active trace. It's generally recommended to use it in a try-with-resource statement to safely control its start and end.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidclose()Simply callsend().voidend()Ends this trace and all sub-traces.ActiveTracestartSubTrace(String label, Object... labelFormatArgs)Starts and returns a new sub-trace which will be the new active trace.
-
-
-
Method Detail
-
startSubTrace
ActiveTrace startSubTrace(String label, Object... labelFormatArgs)
Starts and returns a new sub-trace which will be the new active trace. It's generally recommended to call this method in a try-with-resource.- Parameters:
label- the label to use for this trace; may contain placeholderslabelFormatArgs- the format arguments for the placeholders in the label- Returns:
- the new active sub-trace
-
end
void end()
Ends this trace and all sub-traces.
-
close
default void close()
Simply callsend().- Specified by:
closein interfaceAutoCloseable
-
-