ocaml-trace/test/t1.ml
Simon Cruanes 1735abeb8b
api change: message does not take location
even tracy doesn't have that. Otoh a message should have an optional
span for OTEL.
2023-06-09 16:53:53 -04:00

14 lines
429 B
OCaml

let run () =
Trace.set_process_name "main";
Trace.set_thread_name "t1";
for _i = 1 to 50 do
Trace.with_span ~__FILE__ ~__LINE__ "outer.loop" @@ fun _sp ->
for _j = 2 to 5 do
Trace.with_span ~__FILE__ ~__LINE__ "inner.loop" @@ fun _sp ->
Trace.messagef (fun k -> k "hello %d %d" _i _j)
done
done
let () =
Trace_tef.Internal_.mock_all_ ();
Trace_tef.with_setup ~out:`Stdout @@ fun () -> run ()