Releases: lukstafi/ppx_minidebug
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 ()
Major feature release: better for concurrency, explicit logging, elapsed time tracking
This release helps with:
- using with concurrency via multi-runtime setups: runtime-global prefix, automated runtime parameter generation (but passing still manual)
- using
ppx_minidebug
as a logging framework: explicit logging within a debug scope with%log
- navigating folded logs: elapsed times for log subtrees
- a couple bugs fixed.
Arbitrary patterns, type propagation, Markdown backend, size control
Patterns will now be logged without the need for alias patterns. In addition to let
-bound patterns, now log match
and function
patterns, but only in %track_
debug scopes. We propagate type information top-down, so you don't need to repeat the types or write them in inconvenient places. We merge type information coming from multiple sources discarding type variables. PrintBox Markdown backend is now available, and backends are now fully configurable. There are now more tools to control size of log files: prune_upto
, truncate_children
, split_files_after
.
Hyperlinks and `values_first_mode`
PrintBox-only features: Optionally emit source code pointers as hyperlinks; values_first_mode
which puts the result of a computation in the header, instead of the source code location of the computation. It's important to use values_first_mode
when using hyperlinks, otherwise the tree nodes will not be foldable. Also, more compact printing of small sexp values (inline with the variable / function name).
Track more: anomymous functions, `for` loops
When in an active %track_ scope
: logs previously insufficiently annotated functions, including anonymous functions, logs for
, while
, function
branch syntaxes.
Highlights for search terms; tracking `match` branches
Highlights for paths to nodes matching search terms; tracking executed if
and match
branches.
Backward compatibility and docs update
Fixes pre-4.14 compatibility (Out_channel
) and small tweaks to the documentation.
Support for debugging infinite loops
This release adds a configuration ~max_num_children
, where the logging code will raise a failure once the given number of logs under the same parent is exceeded.
`max_nesting_depth` for debugging infinite recursion
This is a quick release with an option to terminate deeply nested logging to support debugging infinite recursion situations. It also fixes outdated documentation, encouraging first-class modules.
HTML output and quick access runtimes
Delayed release because I wanted to also release to the opam repository, but now I want to fix #9 first.
In this release:
- Collapsible-tree HTML output via PrintBox, with even some sexps converted to PrintBox trees.
- Entry points
debug_html "filename.html"
(as html to a file) anddebug ()
(as PrintBox text to stdout) returning the debug runtime modules. - Closing debug entries on uncaught exceptions.