From 62837c51934aa2ffa0cacec50a95a036ac85df87 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Thu, 22 Aug 2024 14:56:18 -0400 Subject: [PATCH] feat tef: accept a out_channel directly in the collector --- src/tef/trace_tef.ml | 1 + src/tef/trace_tef.mli | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tef/trace_tef.ml b/src/tef/trace_tef.ml index c06c73d..7fea2ae 100644 --- a/src/tef/trace_tef.ml +++ b/src/tef/trace_tef.ml @@ -70,6 +70,7 @@ module Writer = struct | `File path -> open_out path, true | `File_append path -> open_out_gen [ Open_creat; Open_wronly; Open_append ] 0o644 path, true + | `Output oc -> oc, false in let pid = if !Mock_.enabled then diff --git a/src/tef/trace_tef.mli b/src/tef/trace_tef.mli index 03866f0..6c73f13 100644 --- a/src/tef/trace_tef.mli +++ b/src/tef/trace_tef.mli @@ -47,7 +47,7 @@ module Internal_ : sig val collector_jsonl : finally:(unit -> unit) -> - out:[ `File_append of string ] -> + out:[ `File_append of string | `Output of out_channel ] -> unit -> Trace_core.collector