AbstractTraceDriver


public abstract class AbstractTraceDriver implements AutoCloseable

Known direct subclasses
TraceDriver

The entry point to tracing APIs.


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.

Public methods

abstract void

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

abstract void

Flushes the trace packets into the underlying AbstractTraceSink.

final @NonNull AbstractTraceSink

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

abstract @NonNull Tracer

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

final boolean

When isEnabled is true, then the Tracer obtained from the AbstractTraceDriver emits trace events.

Protected constructors

AbstractTraceDriver

Added in 2.0.0-alpha04
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-alpha04
public abstract void close()

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

flush

Added in 2.0.0-alpha04
public abstract void flush()

Flushes the trace packets into the underlying AbstractTraceSink.

getSink

Added in 2.0.0-alpha04
public final @NonNull AbstractTraceSink getSink()

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

getTracer

Added in 2.0.0-alpha04
public abstract @NonNull Tracer getTracer()

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

isEnabled

Added in 2.0.0-alpha04
public final boolean isEnabled()

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