AbstractTraceDriver


public abstract class AbstractTraceDriver implements AutoCloseable
Known direct subclasses

The entry point for the tracing API.

Summary

Protected constructors

AbstractTraceDriver(@NonNull AbstractTraceSink sink, boolean isEnabled)

Builds an instance of AbstractTraceDriver using the provided AbstractTraceSink if isEnabled is true.

Protected constructors

AbstractTraceDriver

Added in 2.0.0-alpha06
protected AbstractTraceDriver(@NonNull AbstractTraceSink sink, boolean isEnabled)

Builds an instance of AbstractTraceDriver using the provided AbstractTraceSink if isEnabled is true. Otherwise, you get an instance of a no-op AbstractTraceDriver.

Public methods

close

Added in 2.0.0-alpha06
public abstract void close()

Flushes all outstanding packets to the AbstractTraceSink and then closes the AbstractTraceSink.

flush

Added in 2.0.0-alpha06
public abstract void flush()

Flushes the trace packets into the underlying AbstractTraceSink.

getSink

Added in 2.0.0-alpha06
public final @NonNull AbstractTraceSinkgetSink()

The AbstractTraceSink that asynchronously serializes trace events to a file or buffer, depending on implementation.

getTracer

Added in 2.0.0-alpha06
public abstract @NonNull TracergetTracer()

Return an instance of a Tracer that can be used to emit trace events.

isEnabled

Added in 2.0.0-alpha06
public final boolean isEnabled()

When isEnabled is true, then the Tracer obtained from the AbstractTraceDriver emits trace events. Otherwise, no events are emitted.