Log levels both at compile time and at runtime; more concise `%log`
The same set of log levels: Nothing
, Prefixed [| prefix1; ... |]
, Prefixed_or_result [| prefix1; ... |]
, Nonempty_entries
, Everything
-- working at compile time and at runtime. Compile-time log levels can be set globally and changed in a local lexical scope, runtime log levels can be set at runtime creation and changed per-runtime at any time.
%log
statements don't need annotating as : string. Example from the test suite:
let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in
let s = "3" in
let pi = "3.14" in
let x2 s = "2*" ^ s in
let l = [ ("1", 1); ("2", 2); ("3", 3) ] in
let%debug_show foo () : unit =
[%log x2 s];
[%log "This is like", s, "or", pi, "above"];
[%log "tau =", x2 pi];
(* Does not work with lists or arrays: *)
(* [%log s :: l]; *)
(* But works for tuples even if nested: *)
[%log (x2 s, 0) :: l]
in
let () = foo ()