%log_level
unregistered extension is now setting the dynamic log level in addition to the lexical log level.
Shared_config
now has aninit_log_level
field, populated from the runtime creation functions'~log_level
argument.- A header
BEGIN DEBUG SESSION
is only output when the (initial) log level is greater than 0. - A debug file is opened (created) lazily, in particular not at initialization if the initial log level is 0.
- We give up on only splitting the flushing backend files at toplevel log boundaries: now a log open and log close can be in different files.
- Outdated README comment: local debug runtimes are not restricted to functions.
values_first_mode
is now the default:?(values_first_mode = true)
.
- Write the whole incomplete log tree on the error "lexical scope of close_log not matching its dynamic scope" by snapshotting, so the entries from the error message can be looked up.
- Don't use
str_formatter
, it's only meant to be used from the main domain. (It affected timestamps, and_pp
entry points for the flushing backend.)
- 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.
- 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 make 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
.
- 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.
- Runtime
description
: where the logs are directed to. - 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.
- Runtime builders take a
description
optional argument. - We now check for the compile-time vs. runtime consistency of log level specifications (#45).
_this_
infix on non-let-binding expressions throws a syntax error instead of being a no-op.- As a design decision aligned with #51, we output the error instead of processing the expression, i.e. we don't ignore the
_this_
infix.
- As a design decision aligned with #51, we output the error instead of processing the expression, i.e. we don't ignore the
_rt_
/_rtb_
entry points now work correctly on non-function expressions, making them functions of the debug runtime.- Not outputting
%log_entry
whenlog_level=Nothing
. - Highlighting of
<returns>
and<values>
.
- Outputs entry ids on the stack when reporting static vs. dynamic scope mismatch failure.
- Promotes
val snapshot : unit -> unit
to the generic interface, implemented as no-op in the flushing backend. - Does not try to debug module bindings.
- An API function
Debug_runtime.open_log_no_source
for log entries without associated source code locations, and a corresponding[%log_entry]
extension point. - A simple, minimalistic version of a Flame Graph output in ToC files (PrintBox backend only).
- A new ToC criterion: elapsed time threshold.
- And-or gates for ToC criteria.
- A setting
verbose_entry_ids
that prefixes logged values with entry id tags. - Log entries now generate anchors, HTML syntax:
<a id=ENTRY_ID></a>
- Table of Contents, initial version (in the future this might be optionally a flame graph).
- Fixes #32: optionally output time spans instead of clock times.
- Breaking: renames
Debug_ch
toShared_config
. - Breaking: replaces the
open_log_preamble_brief
andopen_log_preamble_full
withopen_log
and a settinglocation_format
. - Breaking: Adds
fname
,start_lnum
,entry_id
parameters toclose_log
to debug lexical-vs-dynamic scope mismatches and spurious closes. - Adds
global_prefix
to the error message onclose_log
failure. - Entry ids output with
~print_entry_ids:true
now link to the entry anchors.
- A new entry extension point prefix:
%diagn_
restricts the compile-time log level toPrefixed [||]
, does not change tighter settings (Nothing
,Prefixed [|prefixes...|]
). forget_printbox
snapshot
in the PrintBox backend as in #21.- Optionally,
snapshot ()
at the end of alog_value
call if elapsed time since last snapshot is greater than given threshold. - A replacement
Minidebug_runtime.sexp_of_lazy_t
that does not force the thunk (but prints content if available). - A new extension point
[%log_result]
to convey information in a header. - A new extension point
[%log_printbox]
that directly embeds aPrintBox.t
in the logs, instead of a representation of it. A correspondinglog_value_printbox
entry inMinidebug_runtime.Debug_runtime
. - A new registered extension point
[%%global_debug_log_level_from_env_var "env_var_name"]
.
- Re-interpret
Prefixed [||]
andPrefixed_or_result [||]
to mean "explicit logs only" -- originally (as logic indicates) it was equivalent toNothing
. - Change runtime
Prefixed_or_result
to only output results if an entry would be non-empty without them. - Breaking change: removed the
Pp_format
backend. - More informative headers for tracking: e.g. anonymous functions logged with
fun:file_name:LNUM
instead of__fun
. - When printing sexps, don't escape strings for box-level atoms, print them directly. This can be disabled by setting
sexp_unescape_strings
to false. - A more configurable
debug_flushing
builder. max_inline_sexp_length
is now configurable via adebug_file
call, and the default is bumped to 80.
- Be more defensive about not allowing multiline descriptions and messages.
- Don't output line breaks in time-tagged headers.
- Be more consistent about when entries are opened: open toplevel (extension-point) entries even if not binding anything; don't open nested entries when restricted to explicit logs.
- Nested structure items are not toplevel extension points (fix over-generating log entries e.g. for other ppx extensions).
- Optionally print
entry_id
s for log headers (and escaping logs).
- Do not crash when logging value with an empty entry stack; while unusual, "logs escaping lexical scope" are fine.
- Runtime log levels for the PrintBox backend.
- Compile-time log levels.
%debug_
entry points log un-annotated functions but only the function the entry point is attached to.- Added a default type
string
to%log
expression decomposition, reducing the need for annotations.
_rt_
&_rtb_
should work even when nested inside another debug scope.- Nested entry extension point is still considered toplevel.
- Tighter error locations for
%log
missing types or type errors.
- A shared runtime-wide setting
global_prefix
for prefixing log headers (and closing tags in the flushing backend), to disambiguate (or debug) interactions of different runtime instances. _rt_
resp._rtb_
(e.g.%track_rtb_sexp
) entry points to support runtime-passing, i.e. abstracting over aDebug_runtime
resp.PrintBox_runtime
.- An extension point
%log
that is not registered -- therefore reducing interference with logger ppxs -- and does not open a new log subtree. - Optionally indicate elapsed time in subtree headers in the PrintBox backend.
- Removed the VS Code specific section of the README.
- Slightly breaking change: the
~descr
parameter of the logging functions in the runtimes is now optional.
log_value_pp
would raise a potentially uncaught or misleading exception, now marks a syntax error.- Setting of the global
log_value
was not updated for nested extension points.
- PrintBox Markdown backend.
- Optionally, log to multiple files, opening a new file once a file size threshold is exceeded.
- Continuous Integration tests.
- Fixes #9: handle tuple and record patterns.
- Handle variants patterns, nested patterns, ... pretty much all patterns.
- Log bindings in
match
andfunction
patterns, but only when in a%track_
scope. - Provide pattern text in addition to the branch number (counted from 0).
- Propagate type information top-down and merge different sources of type information.
- Optionally, log the type information found with extension points
%debug_type_info
and%global_debug_type_info
. - A PrintBox-backend option
truncate_children
to limit the amount of output.
- Rename
debug_html
todebug_file
, since it now supports both HTML and Markdown. Take file name/path without a suffix. - Refactored PrintBox configuration, smaller footprint and allowing control over the backends.
- Changed
highlighted_roots
to a more generalprune_upto
: prune to only the highlighted boxes up to the given depth. - Exported
PrintBox_runtime
configuration for better flexibility (in-flight configuration changes). - Refactored the optional termination configuration
max_nesting_depth
andmax_num_children
into extension points%debug_interrupts
and%global_debug_interrupts
.
- In
values_first_mode
, be consistent about what counts as a returned value. - Missing transformations for
%debug_notrace
, and generally for the root construct of a body of a non-logged binding.
- Optionally output source locations as hyperlinks -- requires a (potentially empty) address prefix.
- A setting
values_first_mode
for the PrintBox runtime, to put results of computation as headers, and push paths beneath headers (friendly for HTML-backed foldable output).
- Include the variable name in the open-log line (just as function name for functions).
- Output the description of a for loop body as
<for [identifier]>
rather than just[identifier]
. Debug_runtime
functions now take an~entry_id
parameter, set to a per-entry ID generated byget_entry_id
.- Small non-atomic sexp values can now be printed inline with the variable name (like sexp atoms) rather than spread out as trees.
- When in an active
%track_
scope:- Log
for
loop nesting and indices at the beginning of a loop body. - Log
while
loop nesting. - Log
function
branches (similar tomatch
branches). - Log all functions. Doing it only for
%track_
to reduce noise.- This will log type-annotated arguments of anonymous functions (even when the function result type is not annotated).
- Log
- A new optional PrintBox-only setting
highlight_terms
, which applies a frame / border on paths to leaves matching a regular expression.- A corresponding setting
exclude_on_path
-- if this regular expression matches on a log, its children have no effect on its highlight status. I.e.,exclude_on_path
stops the continued propagation of highlights. - A flag
highlighted_roots
prevents outputting toplevel boxes that have not been highlighted.
- A corresponding setting
- A set of extension points
%track_sexp
,%track_pp
etc. that parallel%debug_sexp
,%debug_pp
etc. but additionally log whichif
andmatch
branch got executed.- An extension point
%debug_notrace
that turns off logging the branch of the specificif
ormatch
expression. It is ignored by the%debug_
extension points.
- An extension point
- Issue #8: ignore nested debug scope indications (don't re-process them).
- Backward compatibility:
Out_channel.output_string
-->Stdlib.output_string
.
Support for debugging infinite loops.
- A new optional setting
max_num_children
, which terminates a computation with aFailure
exception when the given size of sibling logs is exceeded.
- Runtime entry point
debug_flushing
that returns aFlushing
runtime which by default logs tostdout
. - A new optional setting
max_nesting_depth
, which terminates a computation with aFailure
exception when the given nesting of logs is exceeded.
- An option to output to HTML, when in the
PrintBox
runtime. - An option to convert the logged
sexp
values toPrintBox
trees, when they exceed a given size in atoms. - Runtime entry points
debug_html
that returns aPrintBox
runtime configured to output HTML into a file with the given name, anddebug
that returns aPrintBox
runtime which by default logs tostdout
.
- Exception handling that allows proper tracing/logging for raising functions and crashing (via uncaught exception) programs.
- The
PrintBox
logger now allows disabling (not outputting) a whole subtree of the logs.
- A broken link in the documentation landing page.
- Breaking change: explicitly set whether logs should be time tagged.
- Missing version bounds on
ocaml
andppxlib
to make CI happy.
- A small tweak to have
dune-release
work.
- Breaking change: renamed
Minidebug_runtime.Format
toMinidebug_runtime.PP_format
. - Non-optionally depending on
sexplib0
andppx_sexp_conv
, as optional dependency was making it hard to test. Also theminidebug_runtime
source files duplication was ugly. - Trying to minimize dependencies: removed the unused direct dependency on
base
, butppx_sexp_conv
depends on it. Removed the dependency onstdio
. - Added a building-related comment to the documentation.
- Added non-optional package dependencies.
- Major bug fix: missing processing of the top expression in a function body.
- Merged the two packages
ppx_minidebug
andminidebug_runtime
into one.
- Handles labeled function arguments.
- Documentation suggestions regarding VOCaml.
- A syntax extension to instrument type-annotated bindings and functions with logging.
- The extension supports 3 value conversion mechanisms: pp and show from deriving.show, and sexp from ppx_sexp_conv.
- The
minidebug_runtime
package provides 3 logging backends: Format based purely on formatters, Flushing that converts to strings first and flushes output after every entry, and PrintBox that pretty-prints as trees using the printbox package. - References a VS Code extension that builds flame graphs for the
Flushing
logger out-of-the-box. - Documentation and API docs on github.io.
- Tests, including testing the writing-to-files functionality. Uses
sed
for sanitizing.