public DeferredTracer() { this.trace = Tracer.copyTrace(); }
public DeferredTracer() { this.trace = Tracer.copyTrace(); }
/** * Runs the given callable with the current trace at * the time of construction of this {@link DeferredTracer}. */ public <T, E extends Throwable> T withTrace(ThrowingCallable<T, E> inner) throws E { Trace originalTrace = Tracer.copyTrace(); Tracer.setTrace(trace); try { return inner.call(); } finally { Tracer.setTrace(originalTrace); } } }
/** * Runs the given callable with the current trace at * the time of construction of this {@link DeferredTracer}. */ public <T, E extends Throwable> T withTrace(ThrowingCallable<T, E> inner) throws E { Trace originalTrace = Tracer.copyTrace(); Tracer.setTrace(trace); try { return inner.call(); } finally { Tracer.setTrace(originalTrace); } } }