debug
, debug_flushing
._get_local_debug_runtime
: local_runtime
, local_runtime_flushing
, prefixed_runtime
, prefixed_runtime_flushing
.PPX_MINIDEBUG_DEFAULT_COMPILE_LOG_LEVEL
environment variable to avoid forcing everyone to use [%%global_debug_log_level_from_env_var "..."]
in every file.prefixed_runtime_flushing
, we prefix all logs, not only headers._l_
variant entry points become default, and the default variants become _o_
, e.g. %debug_l_sexp
becomes %debug_sexp
, %debug_sexp
becomes %debug_o_sexp
.README.md
/ index.mld
to use MDX: all code samples are automatically lifted from tests (or sync_to_md.ml
) thus guaranteed correct.finish_and_cleanup
to finish or interrupt logging in a safe way (closes the files).README.md
-> index.mld
translation.%log_level
unregistered extension is now setting the dynamic log level in addition to the lexical log level.Shared_config
now has an init_log_level
field, populated from the runtime creation functions' ~log_level
argument.BEGIN DEBUG SESSION
is only output when the (initial) log level is greater than 0.values_first_mode
is now the default: ?(values_first_mode = true)
.str_formatter
, it's only meant to be used from the main domain. (It affected timestamps, and _pp
entry points for the flushing backend.)%debug1_sexp
, %debug2_sexp
, %log1
, %log2
, %log2_result
, %log2_entry
etc. that participate in compile-time log level filtering.%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.%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.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._this_
infix and make all extension points behave as _this_
(not extend to bodies of toplevel bindings)._rtb_
and _lb_
-- all debugging should use the generic interface as it now offers all the functionality except configuration.%diagn
.[%%global_debug_log_level_from_env_var "..."]
consistency check when the environment variable is not defined.description
: where the logs are directed to._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.%%global_debug_log_level_from_env_var
, and %%global_debug_log_level_from_env_var_unsafe
that bypasses the check.description
optional argument._this_
infix on non-let-binding expressions throws a syntax error instead of being a no-op.
_this_
infix._rt_
/ _rtb_
entry points now work correctly on non-function expressions, making them functions of the debug runtime.%log_entry
when log_level=Nothing
.<returns>
and <values>
.val snapshot : unit -> unit
to the generic interface, implemented as no-op in the flushing backend.Debug_runtime.open_log_no_source
for log entries without associated source code locations, and a corresponding [%log_entry]
extension point.verbose_entry_ids
that prefixes logged values with entry id tags.<a id=ENTRY_ID></a>
Debug_ch
to Shared_config
.open_log_preamble_brief
and open_log_preamble_full
with open_log
and a setting location_format
.fname
, start_lnum
, entry_id
parameters to close_log
to debug lexical-vs-dynamic scope mismatches and spurious closes.global_prefix
to the error message on close_log
failure.~print_entry_ids:true
now link to the entry anchors.%diagn_
restricts the compile-time log level to Prefixed [||]
, does not change tighter settings (Nothing
, Prefixed [|prefixes...|]
).forget_printbox
snapshot
in the PrintBox backend as in #21.snapshot ()
at the end of a log_value
call if elapsed time since last snapshot is greater than given threshold.Minidebug_runtime.sexp_of_lazy_t
that does not force the thunk (but prints content if available).[%log_result]
to convey information in a header.[%log_printbox]
that directly embeds a PrintBox.t
in the logs, instead of a representation of it. A corresponding log_value_printbox
entry in Minidebug_runtime.Debug_runtime
.[%%global_debug_log_level_from_env_var "env_var_name"]
.Prefixed [||]
and Prefixed_or_result [||]
to mean "explicit logs only" -- originally (as logic indicates) it was equivalent to Nothing
.Prefixed_or_result
to only output results if an entry would be non-empty without them.Pp_format
backend.fun:file_name:LNUM
instead of __fun
.sexp_unescape_strings
to false.debug_flushing
builder.max_inline_sexp_length
is now configurable via a debug_file
call, and the default is bumped to 80.entry_id
s for log headers (and escaping logs).%debug_
entry points log un-annotated functions but only the function the entry point is attached to.string
to %log
expression decomposition, reducing the need for annotations._rt_
& _rtb_
should work even when nested inside another debug scope.
%log
missing types or type errors.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 a Debug_runtime
resp. PrintBox_runtime
.%log
that is not registered -- therefore reducing interference with logger ppxs -- and does not open a new log subtree.~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.log_value
was not updated for nested extension points.match
and function
patterns, but only when in a %track_
scope.%debug_type_info
and %global_debug_type_info
.truncate_children
to limit the amount of output.debug_html
to debug_file
, since it now supports both HTML and Markdown. Take file name/path without a suffix.highlighted_roots
to a more general prune_upto
: prune to only the highlighted boxes up to the given depth.PrintBox_runtime
configuration for better flexibility (in-flight configuration changes).max_nesting_depth
and max_num_children
into extension points %debug_interrupts
and %global_debug_interrupts
.values_first_mode
, be consistent about what counts as a returned value.%debug_notrace
, and generally for the root construct of a body of a non-logged binding.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).<for [identifier]>
rather than just [identifier]
.Debug_runtime
functions now take an ~entry_id
parameter, set to a per-entry ID generated by get_entry_id
.When in an active %track_
scope:
for
loop nesting and indices at the beginning of a loop body.while
loop nesting.function
branches (similar to match
branches).Log all functions. Doing it only for %track_
to reduce noise.
A new optional PrintBox-only setting highlight_terms
, which applies a frame / border on paths to leaves matching a regular expression.
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.highlighted_roots
prevents outputting toplevel boxes that have not been highlighted.A set of extension points %track_sexp
, %track_pp
etc. that parallel %debug_sexp
, %debug_pp
etc. but additionally log which if
and match
branch got executed.
%debug_notrace
that turns off logging the branch of the specific if
or match
expression. It is ignored by the %debug_
extension points.Out_channel.output_string
--> Stdlib.output_string
.Support for debugging infinite loops.
max_num_children
, which terminates a computation with a Failure
exception when the given size of sibling logs is exceeded.debug_flushing
that returns a Flushing
runtime which by default logs to stdout
.max_nesting_depth
, which terminates a computation with a Failure
exception when the given nesting of logs is exceeded.PrintBox
runtime.sexp
values to PrintBox
trees, when they exceed a given size in atoms.debug_html
that returns a PrintBox
runtime configured to output HTML into a file with the given name, and debug
that returns a PrintBox
runtime which by default logs to stdout
.PrintBox
logger now allows disabling (not outputting) a whole subtree of the logs.ocaml
and ppxlib
to make CI happy.dune-release
work.Minidebug_runtime.Format
to Minidebug_runtime.PP_format
.sexplib0
and ppx_sexp_conv
, as optional dependency was making it hard to test. Also the minidebug_runtime
source files duplication was ugly.base
, but ppx_sexp_conv
depends on it. Removed the dependency on stdio
.ppx_minidebug
and minidebug_runtime
into one.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.Flushing
logger out-of-the-box.sed
for sanitizing.