mirror of
https://github.com/ocaml-tracing/ocaml-trace.git
synced 2026-03-07 18:37:56 -05:00
format using 0.27
This commit is contained in:
parent
d737022e11
commit
477cc21bf1
3 changed files with 12 additions and 12 deletions
|
|
@ -1,4 +1,4 @@
|
|||
version = 0.26.2
|
||||
version = 0.27.0
|
||||
profile=conventional
|
||||
margin=80
|
||||
if-then-else=k-r
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
(** Write fuchsia events into buffers.
|
||||
|
||||
Reference: https://fuchsia.dev/fuchsia-src/reference/tracing/trace-format *)
|
||||
Reference: https://fuchsia.dev/fuchsia-src/reference/tracing/trace-format *)
|
||||
|
||||
module Util = Util
|
||||
module Buf = Buf
|
||||
|
|
@ -37,7 +37,8 @@ end
|
|||
|
||||
open struct
|
||||
(** maximum length as specified in the
|
||||
{{: https://fuchsia.dev/fuchsia-src/reference/tracing/trace-format} spec} *)
|
||||
{{:https://fuchsia.dev/fuchsia-src/reference/tracing/trace-format} spec}
|
||||
*)
|
||||
let max_str_len = 32000
|
||||
|
||||
(** Length of string, in words *)
|
||||
|
|
@ -68,8 +69,8 @@ module Str_ref = struct
|
|||
(1 lsl 15) lor size
|
||||
end
|
||||
|
||||
(** [truncate_string s] truncates [s] to the maximum length allowed for
|
||||
strings. If [s] is already short enough, no allocation is done. *)
|
||||
(** [truncate_string s] truncates [s] to the maximum length allowed for strings.
|
||||
If [s] is already short enough, no allocation is done. *)
|
||||
let[@inline] truncate_string s : string =
|
||||
if String.length s <= max_str_len then
|
||||
s
|
||||
|
|
|
|||
|
|
@ -48,8 +48,8 @@ module Writer = struct
|
|||
must_close: bool; (** Do we have to close the underlying channel [oc]? *)
|
||||
pid: int;
|
||||
}
|
||||
(** A writer to a [out_channel]. It writes JSON entries in an array
|
||||
and closes the array at the end. *)
|
||||
(** A writer to a [out_channel]. It writes JSON entries in an array and closes
|
||||
the array at the end. *)
|
||||
|
||||
let create ~(mode : [ `Single | `Jsonl ]) ~out () : t =
|
||||
let jsonl = mode = `Jsonl in
|
||||
|
|
@ -237,9 +237,8 @@ let print_non_closed_spans_warning spans =
|
|||
!names;
|
||||
flush stderr
|
||||
|
||||
(** Background thread, takes events from the queue, puts them
|
||||
in context using local state, and writes fully resolved
|
||||
TEF events to [out]. *)
|
||||
(** Background thread, takes events from the queue, puts them in context using
|
||||
local state, and writes fully resolved TEF events to [out]. *)
|
||||
let bg_thread ~mode ~out (events : Event.t B_queue.t) : unit =
|
||||
block_signals ();
|
||||
|
||||
|
|
@ -308,8 +307,8 @@ let bg_thread ~mode ~out (events : Event.t B_queue.t) : unit =
|
|||
if Span_tbl.length spans > 0 then print_non_closed_spans_warning spans;
|
||||
()
|
||||
|
||||
(** Thread that simply regularly "ticks", sending events to
|
||||
the background thread so it has a chance to write to the file *)
|
||||
(** Thread that simply regularly "ticks", sending events to the background
|
||||
thread so it has a chance to write to the file *)
|
||||
let tick_thread events : unit =
|
||||
block_signals ();
|
||||
try
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue