public static void finishTracer(Consumer<? super Exception> exceptionHandler) {
    if (fileState == null) return;
    new FlushingTask(fileState, true, exceptionHandler).run();
    fileState = null;
    executor.shutdown();
    executor = null;
    Runtime.getRuntime().removeShutdownHook(shutdownHook);
    running = false;
  }
public static void finishTracer(Consumer<? super Exception> exceptionHandler)