Releases: lukstafi/ppx_minidebug
Initial log level
In this release, creating a debug runtime always sets its log level to an initial value (default 9). If the initial log level = 0, the header BEGIN DEBUG SESSION
is not logged. Opening (creating) a debug file is postponed so that no file is created if the log level starts and remains at 0.
Values first mode by default; bug fixes
This release makes ~values_first_mode:true
the default.
This release fixes logging time tags from other domains -- removes the use of str_formatter
which by design only works with the main domain.
Another fix: for the error lexical scope of close_log not matching its dynamic scope
, we properly snapshot the logs.
Linear verbosity log levels
This release is mostly about migrating the logging framework to the familiar, linear log levels with verbosity varying from 0 (nothing logged) to 9. It also makes some backward-incompatible simplifications, in particular it gets rid of the _this_
infix. From the CHANGELOG:
Added
- Compile-time explicit log levels
%debug1_sexp
,%debug2_sexp
,%log1
,%log2
,%log2_result
,%log2_entry
etc. that participate in compile-time log level filtering. - Runtime log levels
%at_log_level
,%logN
,%logN_result
,%logN_printbox
that take the level at which to log as argument. Note: not supported for extension entry points%debug_sexp
etc. - New unregistered extension point
%log_block
(similar to%log_entry
) that assumes its body is logging code only, and does both compile-time and runtime pruning of the body according to the log level. Limited to unit-type bodies.
Changed
- Moved
no_debug_if
to the generic interface (the last remaining non-config functionality missing from it). It's ignored (no-op) for the flushing backend. - Moved to linear log levels per-entry and per-log, where an unspecified log level inherits from the entry it's in, determined statically.
- Removed
_this_
infix and made all extension points behave as_this_
(not extend to bodies of toplevel bindings). - Removed
_rtb_
and_lb_
-- all debugging should use the generic interface as it now offers all the functionality except configuration. - Removed a heuristic to not print extra debug information at log level 1 -- replaced by checking for
%diagn
.
Bug-fix release (log levels consistency check)
From the changelog:
Fixed
- Write the log tree on the error "lexical scope of close_log not matching its dynamic scope", so the entries from the error message can be looked up.
- Uncaught exception in the
[%%global_debug_log_level_from_env_var "..."]
consistency check when the environment variable is not defined.
Local debug runtimes; compile-time vs. runtime log levels check
A new family of entry points _l_
resp. _lb_
that retrieve debug runtimes via a call _get_local_debug_runtime ()
resp. _get_local_printbox_debug_runtime ()
: these functions are correspondingly expected in the scope. The entry points facilitate using thread-local (and domain-local) debug runtimes.
Compile-time vs. runtime consistency check for %%global_debug_log_level_from_env_var
, and %%global_debug_log_level_from_env_var_unsafe
that bypasses the check.
Does not try to debug module bindings
A very minor release addressing a pain point: module arguments often require type annotations, but cannot be logged by the sexp derivers.
Flame graphs, and explicit log subtrees with `%log_entry`
This release brings:
- the
[%log_entry]
(unregistered) extension point for explicitly creating log subtrees without source location information, - flame graphs in Table of Contents files,
- more flexible configuration of entries to include in a ToC, in particular setting minimal time duration (span).
Log entry anchors and _Table of Contents_
This release:
- creates anchors for log entries, hyperlinked via
~print_entry_ids:true
output, - implements a Table of Contents functionality (as hyperlinks to log entry anchors),
- helps debugging lexical-vs-dynamic scope mismatches for log entries,
- cleans up the PPX-facing API and adds flexibility with a
location_format
argument.
Many improvements to the "logging framework" use-case
Many improvements, see CHANGELOG.md for details. Highlights:
- A new registered extension point prefix
%diagn_
that restricts the log level to explicit logs. - Periodic snapshotting of un-closed log trees.
- Make your logs nicer with
%log_result
(to be paired withvalues_first_mode
) and%log_printbox
. - Breaking: getting rid of
Pp_format
.
P.S. While waiting for a bug fix PrintBox 0.10.1 release and then ppx_minidebug 1.3.1, you can apply the fix to line breaks in the HTML output by installing printbox from sources.
Allow logs escaping all lexical debugging scopes
- Logs escaping all scopes are called "orphaned", and printed with the entry_id of where they come from.
- An option print_entry_ids to print entry ids together with (after) code paths.