diff --git a/CHANGELOG.md b/CHANGELOG.md index 6203d20..c1ff94e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ - 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. +### Fixed + +- Outdated README comment: local debug runtimes are not restricted to functions. + ## [2.0.1] -- 2024-09-08 ### Changed diff --git a/README.md b/README.md index 61a018f..fff37fe 100644 --- a/README.md +++ b/README.md @@ -1300,7 +1300,7 @@ For programs with threads or domains running concurrently, you need to ensure th We offer three helpers for dealing with multiple debug runtimes. There is an optional runtime instance-level setting `global_prefix`, which adds the given information to all log headers coming from the instance. -There are extension points `%debug_l_sexp`, `%track_l_sexp`, etc. They call a function `_get_local_debug_runtime ()` and unpack the argument as `module Debug_runtime` (in a function body). The feature helps using a runtime instance dedicated to a thread or domain, since for example `_get_local_debug_runtime` can retrieve the runtime using `Domain.DLS`. To avoid surprises, this feature only takes effect for directly annotated functions, and unpacks a `Debug_runtime` inside the function body, so that we get the appropriate runtime for the dynamic local scope. +There are extension points `%debug_l_sexp`, `%track_l_sexp`, etc. They call a function `_get_local_debug_runtime ()` and unpack the argument as `module Debug_runtime` (in a function body). The feature helps using a runtime instance dedicated to a thread or domain, since for example `_get_local_debug_runtime` can retrieve the runtime using `Domain.DLS`. To avoid surprises, in case of directly annotated functions, this feature unpacks a `Debug_runtime` inside the function body, so that we get the appropriate runtime for the dynamic local scope. NOTE: it's important to annotate functions that might be called from threads (spawned domains) using the `_l_` variants of extension points, e.g. `%debug_l_sexp` (not `%debug_sexp`!). For clearest output, should configure `_get_local_debug_runtime ()` to return the same runtime as the `Debug_runtime` module that is in a file-wide scope, when called from the main thread / main domain. diff --git a/dune-project b/dune-project index fe9b714..2f116e8 100644 --- a/dune-project +++ b/dune-project @@ -15,7 +15,7 @@ (documentation https://lukstafi.github.io/ppx_minidebug/ppx_minidebug) -(version 2.0.1) +(version 2.0.2) (package (name ppx_minidebug) diff --git a/index.mld b/index.mld index a506382..5f348a1 100644 --- a/index.mld +++ b/index.mld @@ -1370,7 +1370,7 @@ For programs with threads or domains running concurrently, you need to ensure th We offer three helpers for dealing with multiple debug runtimes. There is an optional runtime instance-level setting [global_prefix], which adds the given information to all log headers coming from the instance. -There are extension points [%debug_l_sexp], [%track_l_sexp], etc. They call a function [_get_local_debug_runtime ()] and unpack the argument as [module Debug_runtime] (in a function body). The feature helps using a runtime instance dedicated to a thread or domain, since for example [_get_local_debug_runtime] can retrieve the runtime using [Domain.DLS]. To avoid surprises, this feature only takes effect for directly annotated functions, and unpacks a [Debug_runtime] inside the function body, so that we get the appropriate runtime for the dynamic local scope. +There are extension points [%debug_l_sexp], [%track_l_sexp], etc. They call a function [_get_local_debug_runtime ()] and unpack the argument as [module Debug_runtime] (in a function body). The feature helps using a runtime instance dedicated to a thread or domain, since for example [_get_local_debug_runtime] can retrieve the runtime using [Domain.DLS]. To avoid surprises, in case of directly annotated functions, this feature unpacks a [Debug_runtime] inside the function body, so that we get the appropriate runtime for the dynamic local scope. NOTE: it's important to annotate functions that might be called from threads (spawned domains) using the [_l_] variants of extension points, e.g. [%debug_l_sexp] (not [%debug_sexp]!). For clearest output, should configure [_get_local_debug_runtime ()] to return the same runtime as the [Debug_runtime] module that is in a file-wide scope, when called from the main thread / main domain. diff --git a/minidebug_runtime.mli b/minidebug_runtime.mli index e847d39..c0c3527 100644 --- a/minidebug_runtime.mli +++ b/minidebug_runtime.mli @@ -81,8 +81,10 @@ val shared_config : instead of a file name, will use [global_prefix] instead for the anchor links. The setting [toc_entry] controls the selection of headers to include in a ToC (it defaults to [And []], which means including all entries). - - [log_level], is provided, specifies {!Shared_config.init_log_level}. *) + + [log_level], by default 9, specifies {!Shared_config.init_log_level}. This is the + initial log level. In particular, the header "BEGIN DEBUG SESSION" is only printed if + (initial) [log_level > 0]. *) (** When using the {{:http://lukstafi.github.io/ppx_minidebug/ppx_minidebug/Minidebug_runtime/index.html} diff --git a/ppx_minidebug.opam b/ppx_minidebug.opam index b93ebe5..acb088d 100644 --- a/ppx_minidebug.opam +++ b/ppx_minidebug.opam @@ -1,6 +1,6 @@ # This file is generated by dune, edit dune-project instead opam-version: "2.0" -version: "2.0.1" +version: "2.0.2" synopsis: "Debug logs for selected functions and let-bindings" description: "Formatted logs of let-bound values, function arguments and results; `if` and `match` branches taken. Optionally, as collapsible HTML trees with highlights."