mirror of
https://github.com/ocaml-tracing/ocaml-trace.git
synced 2026-03-07 18:37:56 -05:00
fix: beware of dummy trace id
This commit is contained in:
parent
94a061cef7
commit
d737022e11
2 changed files with 8 additions and 2 deletions
|
|
@ -11,6 +11,9 @@ open struct
|
|||
let spf = Printf.sprintf
|
||||
|
||||
let[@inline] int64_of_trace_id_ (id : Trace_core.trace_id) : int64 =
|
||||
if id == Trace_core.Collector.dummy_trace_id then
|
||||
0L
|
||||
else
|
||||
Bytes.get_int64_le (Bytes.unsafe_of_string id) 0
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@ module A = Trace_core.Internal_.Atomic_
|
|||
let on_tracing_error = ref (fun s -> Printf.eprintf "trace-tef error: %s\n%!" s)
|
||||
|
||||
let[@inline] int64_of_trace_id_ (id : Trace_core.trace_id) : int64 =
|
||||
if id == Trace_core.Collector.dummy_trace_id then
|
||||
0L
|
||||
else
|
||||
Bytes.get_int64_le (Bytes.unsafe_of_string id) 0
|
||||
|
||||
module Mock_ = struct
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue