package trace

  1. Overview
  2. Docs
A lightweight stub for tracing/observability, agnostic in how data is collected

Install

dune-project
 Dependency

Authors

Maintainers

Sources

trace-0.12.tbz
sha256=c173d6bf9433e9eeb41bbddda116a296373d45865841dcbb78bff3be8abd9fd8
sha512=1105c52112095fdc8d4961d7346b02e416627bde6ac79ddd137bff63ac0ff5cd23fa53192be642614efadb9cb0cbb83b7d571bb5a0d100ad0ae6d10bc61d3bba

doc/src/trace.core/level.ml.html

Source file level.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
(** Tracing levels.

    This is similar to log levels in, say, [Logs]. In a thoroughly instrumented
    program, there will be a {b lot} of spans, and enabling them all in
    production might slow down the application or overwhelm the tracing system;
    yet they might be useful in debug situations.

    @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 0.7 *)
type t =
  | Error  (** Only errors *)
  | Warning  (** Warnings *)
  | Info
  | Debug1  (** Least verbose debugging level *)
  | Debug2  (** Intermediate verbosity debugging level *)
  | Debug3  (** Maximum verbosity debugging level *)
  | Trace  (** Enable everything (default level) *)

(** @since 0.7 *)
let to_string : t -> string = function
  | Error -> "error"
  | Warning -> "warning"
  | Info -> "info"
  | Debug1 -> "debug1"
  | Debug2 -> "debug2"
  | Debug3 -> "debug3"
  | Trace -> "trace"

let[@inline] leq (a : t) (b : t) : bool = a <= b