From 62063f3f941224b6532d588f0926cd3a22cc194a Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Fri, 8 Mar 2024 11:59:07 -0500 Subject: [PATCH] prepare for 0.7 --- CHANGES.md | 7 +++++++ dune-project | 2 +- ppx_trace.opam | 2 +- src/core/level.ml | 6 +++--- src/core/trace_core.mli | 24 ++++++++++++------------ trace-fuchsia.opam | 2 +- trace-tef.opam | 2 +- trace.opam | 2 +- 8 files changed, 27 insertions(+), 20 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 1e39398..ae8e411 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,11 @@ +# 0.7 + +- feat: add levels to `Trace_core`. Levels are similar to `logs` levels, to help control verbosity. +- add hmap as a depopt (#28) + +- fix: truncate large strings in fuchsia + # 0.6 - add `ppx_trace` for easier instrumentation. diff --git a/dune-project b/dune-project index 74d4fd4..b800cb3 100644 --- a/dune-project +++ b/dune-project @@ -2,7 +2,7 @@ (name trace) (generate_opam_files true) -(version 0.6) +(version 0.7) (source (github c-cube/ocaml-trace)) diff --git a/ppx_trace.opam b/ppx_trace.opam index 62336a6..e4f2ef7 100644 --- a/ppx_trace.opam +++ b/ppx_trace.opam @@ -1,6 +1,6 @@ # This file is generated by dune, edit dune-project instead opam-version: "2.0" -version: "0.6" +version: "0.7" synopsis: "A ppx-based preprocessor for trace" maintainer: ["Simon Cruanes"] authors: ["Simon Cruanes"] diff --git a/src/core/level.ml b/src/core/level.ml index 6ba351f..d6d7ebb 100644 --- a/src/core/level.ml +++ b/src/core/level.ml @@ -6,12 +6,12 @@ down the application or overwhelm the tracing system; yet they might be useful in debug situations. - @since NEXT_RELEASE *) + @since 0.7 *) (** Level of tracing. These levels are in increasing order, i.e if level [Debug1] is enabled, everything below it (Error, Warning, Info, etc.) are also enabled. - @since NEXT_RELEASE *) + @since 0.7 *) type t = | Error (** Only errors *) | Warning (** Warnings *) @@ -21,7 +21,7 @@ type t = | Debug3 (** Maximum verbosity debugging level *) | Trace (** Enable everything (default level) *) -(** @since NEXT_RELEASE *) +(** @since 0.7 *) let to_string : t -> string = function | Error -> "error" | Warning -> "warning" diff --git a/src/core/trace_core.mli b/src/core/trace_core.mli index 85b4b8f..735b7c6 100644 --- a/src/core/trace_core.mli +++ b/src/core/trace_core.mli @@ -24,12 +24,12 @@ val enabled : unit -> bool val get_default_level : unit -> Level.t (** Current default level for spans. - @since NEXT_RELEASE *) + @since 0.7 *) val set_default_level : Level.t -> unit (** Set level used for spans that do not specify it. The default default value is [Level.Trace]. - @since NEXT_RELEASE *) + @since 0.7 *) val with_span : ?level:Level.t -> @@ -47,7 +47,7 @@ val with_span : This is the recommended way to instrument most code. - @param level optional level for this span. since NEXT_RELEASE. + @param level optional level for this span. since 0.7. Default is set via {!set_default_level}. {b NOTE} an important restriction is that this is only supposed to @@ -67,7 +67,7 @@ val enter_span : span (** Enter a span manually. - @param level optional level for this span. since NEXT_RELEASE. + @param level optional level for this span. since 0.7. Default is set via {!set_default_level}. *) val exit_span : span -> unit @@ -98,7 +98,7 @@ val enter_manual_sub_span : start and stop on one thread, and are nested purely by their timestamp; and [`Async] spans can overlap, migrate between threads, etc. (as happens in Lwt, Eio, Async, etc.) which impacts how the collector might represent them. - @param level optional level for this span. since NEXT_RELEASE. + @param level optional level for this span. since 0.7. Default is set via {!set_default_level}. @since 0.3 *) @@ -115,7 +115,7 @@ val enter_manual_toplevel_span : [explicit_span] around until it's exited with {!exit_manual_span}. The span can be used as a parent in {!enter_manual_sub_span}. @param flavor see {!enter_manual_sub_span} for more details. - @param level optional level for this span. since NEXT_RELEASE. + @param level optional level for this span. since 0.7. Default is set via {!set_default_level}. @since 0.3 *) @@ -140,7 +140,7 @@ val message : unit (** [message msg] logs a message [msg] (if a collector is installed). Additional metadata can be provided. - @param level optional level for this span. since NEXT_RELEASE. + @param level optional level for this span. since 0.7. Default is set via {!set_default_level}. @param span the surrounding span, if any. This might be ignored by the collector. *) @@ -153,7 +153,7 @@ val messagef : (** [messagef (fun k->k"hello %s %d!" "world" 42)] is like [message "hello world 42!"] but only computes the string formatting if a collector is installed. - @param level optional level for this span. since NEXT_RELEASE. + @param level optional level for this span. since 0.7. Default is set via {!set_default_level}. *) val set_thread_name : string -> unit @@ -174,7 +174,7 @@ val counter_int : unit (** Emit a counter of type [int]. Counters represent the evolution of some quantity over time. - @param level optional level for this span. since NEXT_RELEASE. + @param level optional level for this span. since 0.7. Default is set via {!set_default_level}. @param data metadata for this metric (since 0.4) *) @@ -185,7 +185,7 @@ val counter_float : float -> unit (** Emit a counter of type [float]. See {!counter_int} for more details. - @param level optional level for this span. since NEXT_RELEASE. + @param level optional level for this span. since 0.7. Default is set via {!set_default_level}. @param data metadata for this metric (since 0.4) *) @@ -204,12 +204,12 @@ val setup_collector : collector -> unit val get_current_level : unit -> Level.t (** Get current level. This is only meaningful if a collector was set up with {!setup_collector}. - @since NEXT_RELEASE *) + @since 0.7 *) val set_current_level : Level.t -> unit (** Set the current level of tracing. This only has a visible effect if a collector was installed with {!setup_collector}. - @since NEXT_RELEASE *) + @since 0.7 *) val shutdown : unit -> unit (** [shutdown ()] shutdowns the current collector, if one was installed, diff --git a/trace-fuchsia.opam b/trace-fuchsia.opam index dfeda26..458183a 100644 --- a/trace-fuchsia.opam +++ b/trace-fuchsia.opam @@ -1,6 +1,6 @@ # This file is generated by dune, edit dune-project instead opam-version: "2.0" -version: "0.6" +version: "0.7" synopsis: "A high-performance backend for trace, emitting a Fuchsia trace into a file" maintainer: ["Simon Cruanes"] diff --git a/trace-tef.opam b/trace-tef.opam index 0953fb4..2c255e7 100644 --- a/trace-tef.opam +++ b/trace-tef.opam @@ -1,6 +1,6 @@ # This file is generated by dune, edit dune-project instead opam-version: "2.0" -version: "0.6" +version: "0.7" synopsis: "A simple backend for trace, emitting Catapult/TEF JSON into a file" maintainer: ["Simon Cruanes"] diff --git a/trace.opam b/trace.opam index 23ebddf..0e46ffe 100644 --- a/trace.opam +++ b/trace.opam @@ -1,6 +1,6 @@ # This file is generated by dune, edit dune-project instead opam-version: "2.0" -version: "0.6" +version: "0.7" synopsis: "A stub for tracing/observability, agnostic in how data is collected" maintainer: ["Simon Cruanes"]