Interface ActiveTrace

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
ActiveTraceImpl, NoOpActiveTrace

public interface ActiveTrace extends AutoCloseable
An ActiveTrace is 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

    Modifier and Type
    Method
    Description
    default void
    Simply calls end().
    void
    end()
    Ends this trace and all sub-traces.
    startSubTrace(String label, Object... labelFormatArgs)
    Starts and returns a new sub-trace which will be the new active trace.
  • Method Details

    • 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 placeholders
      labelFormatArgs - 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 calls end().
      Specified by:
      close in interface AutoCloseable