mirror of
https://github.com/ocaml-tracing/ocaml-trace.git
synced 2026-03-08 03:47:57 -04:00
feat tef-tldrs: use EMIT_TEF_AT_EXIT
This commit is contained in:
parent
46242cd817
commit
8f195adff9
1 changed files with 5 additions and 4 deletions
|
|
@ -96,15 +96,16 @@ let subscriber_ (client : as_client) : Trace_subscriber.t =
|
|||
|
||||
(* what to do when the collector shuts down *)
|
||||
let finally () =
|
||||
(* ask the collector to emit the trace in a user-chosen file, perhaps *)
|
||||
Option.iter
|
||||
(fun file -> fpf out "EMIT_TEF %s\n" file)
|
||||
client.emit_tef_at_exit;
|
||||
(try flush out with _ -> ());
|
||||
try Unix.close sock with _ -> ()
|
||||
in
|
||||
|
||||
fpf out "OPEN %s\n%!" client.trace_id;
|
||||
(* ask the collector to emit the trace in a user-chosen file, perhaps *)
|
||||
Option.iter
|
||||
(fun file -> fpf out "EMIT_TEF_AT_EXIT %s\n" file)
|
||||
client.emit_tef_at_exit;
|
||||
|
||||
Trace_tef.Private_.subscriber_jsonl ~finally ~out:(`Output out) ()
|
||||
|
||||
let subscriber ~out () =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue