Skip to content

Commit

Permalink
Update documentation and prepare release 2.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
lukstafi committed Oct 18, 2024
1 parent 8cb8918 commit 21195df
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion index.mld
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
6 changes: 4 additions & 2 deletions minidebug_runtime.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion ppx_minidebug.opam
Original file line number Diff line number Diff line change
@@ -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."
Expand Down

0 comments on commit 21195df

Please sign in to comment.