Skip to content

Commit

Permalink
add get_default_level()
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Mar 5, 2024
1 parent dc6eefc commit 4fee82b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/core/trace_core.ml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ let[@inline] enabled () =
| None -> false
| Some _ -> true

let[@inline] get_default_level l = A.get default_level_
let[@inline] set_default_level l = A.set default_level_ l
let[@inline] set_current_level l = A.set current_level_ l
let[@inline] get_current_level () = A.get current_level_
Expand Down
7 changes: 6 additions & 1 deletion src/core/trace_core.mli
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@ val enabled : unit -> bool
This is fast, so that the traced program can check it before creating
any span or message. *)

val get_default_level : unit -> Level.t
(** Current default level for spans.
@since NEXT_RELEASE *)

val set_default_level : Level.t -> unit
(** Set level used for spans that do not specify it. The default
default value is [Level.Trace] *)
default value is [Level.Trace].
@since NEXT_RELEASE *)

val with_span :
?level:Level.t ->
Expand Down

0 comments on commit 4fee82b

Please sign in to comment.