Module Trace_tef.Exporter

An exporter, takes JSON objects and writes them somewhere

type t = {
  1. on_json : Stdlib.Buffer.t -> unit;
    (*

    Takes a buffer and writes it somewhere. The buffer is only valid during this call and must not be stored.

    *)
  2. flush : unit -> unit;
    (*

    Force write

    *)
  3. close : unit -> unit;
    (*

    Close underlying resources

    *)
}

An exporter, takes JSON objects and writes them somewhere.

This should be thread-safe if used in a threaded environment.

val of_out_channel : close_channel:bool -> jsonl:bool -> out_channel -> t

Export to the channel

  • parameter jsonl

    if true, export as a JSON object per line, otherwise export as a single big JSON array.

  • parameter close_channel

    if true, closing the exporter will close the channel

val of_buffer : jsonl:bool -> Stdlib.Buffer.t -> t