From 688e2d392227613973651c026a21f39ac2a42a0d Mon Sep 17 00:00:00 2001 From: Lukasz Stafiniak Date: Sun, 8 Sep 2024 21:19:12 +0200 Subject: [PATCH] Make `~values_first_mode:true` the default --- CHANGELOG.md | 4 + README.md | 49 ++++--- minidebug_runtime.ml | 6 +- minidebug_runtime.mli | 2 +- test/debugger_sexp_html-toc.expected.html | 10 +- test/debugger_sexp_html.expected.html | 10 +- test/debugger_sexp_printbox.expected.log | 68 ++++----- test/test_debug_md.ml | 2 +- test/test_debug_multifile.ml | 2 +- test/test_debug_sexp.expected.ml | 93 ++++++------ test/test_debug_sexp.ml | 2 + test/test_debug_time_spans.ml | 2 +- test/test_expect_test.ml | 164 +++++++++++----------- 13 files changed, 213 insertions(+), 201 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53db818..cd583e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## [2.0.1] -- 2024-09-08 +### Changed + +- `values_first_mode` is now the default: `?(values_first_mode = true)`. + ### Fixed - 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. diff --git a/README.md b/README.md index 49eb847..700c54f 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ - [Highlighting search terms](#highlighting-search-terms) - [PrintBox creating helpers with defaults: debug and debug_file](#printbox-creating-helpers-with-defaults-debug-and-debug_file) - [Hyperlinks to source locations](#hyperlinks-to-source-locations) - - [Recommended: values_first_mode](#recommended-values_first_mode) + - [values_first_mode](#values_first_mode) - [Usage](#usage) - [Breaking infinite recursion with max_nesting_depth and looping with max_num_children; Flushing-based traces](#breaking-infinite-recursion-with-max_nesting_depth-and-looping-with-max_num_children-flushing-based-traces) - [Tracking: control flow branches, anonymous and insufficiently annotated functions](#tracking-control-flow-branches-anonymous-and-insufficiently-annotated-functions) @@ -38,6 +38,7 @@ or using the `PrintBox` functor, e.g.: ```ocaml module Debug_runtime = Minidebug_runtime.PrintBox((val Minidebug_runtime.shared_config "path/to/debugger_printbox.log" end)) +let () = Debug_runtime.config.values_first_mode <- false ``` The logged traces will be pretty-printed as trees using the `printbox` package. Truncated example (using `%debug_sexp`): @@ -96,8 +97,11 @@ The `PrintBox` runtime can be configured to output logs using HTML or Markdown. ```ocaml module Debug_runtime = Minidebug_runtime.PrintBox ((val Minidebug_runtime.shared_config "debug.html")) -let () = Debug_runtime.(html_config := `Html default_html_config) -let () = Debug_runtime.boxify_sexp_from_size := 50 +let () = + let c = Debug_runtime.config in + c.backend <- `Html Minidebug_runtime.default_html_config; + c.boxify_sexp_from_size <- 50; + c.values_first_mode <- false ``` Here we also convert the logged `sexp` values (with at least 50 atoms) to trees. Example result: @@ -143,15 +147,15 @@ the prefixes for Markdown / HTML outputs I might use at the time of writing: - if left-clicking a link from within VS Code Live Preview follows the file in the HTML preview window rather than an editor window, middle-click the link - `~hyperlink:"https://github.com/lukstafi/ppx_minidebug/tree/main/"` -### Recommended: `values_first_mode` +### `values_first_mode` -This setting puts the result of the computation as the header of a computation subtree, rather than the source code location of the computation. I recommend using this setting as it reduces noise and makes the important information easier to find and visible with less unfolding. Another important benefit is that it makes hyperlinks usable, by pushing them from the summary line to under the fold. I decided to not make it the default setting, because it is not available in the `Flushing` runtime, and can be confusing. +This setting, by default `true`, puts the result of the computation as the header of a computation subtree, rather than the source code location of the computation. I recommend using this setting as it reduces noise and makes the important information easier to find and visible with less unfolding. Another important benefit is that it makes hyperlinks usable, by pushing them from the summary line to under the fold. It is the default setting, but can be disabled by passing `~values_first_mode:false` to runtime builders, because it can be confusing: the logs are no longer ordered by computation time. It is not available in the `Flushing` runtime. For example: ```ocaml module Debug_runtime = - (val Minidebug_runtime.debug ~highlight_terms:(Re.str "3") ~values_first_mode:true ()) + (val Minidebug_runtime.debug ~highlight_terms:(Re.str "3") ()) let%debug_show rec loop_highlight (x : int) : int = let z : int = (x - 1) / 2 in if x <= 0 then 0 else z + loop_highlight (z + (x / 2)) @@ -254,7 +258,7 @@ let%debug_show _bar : unit = The `%debug_interrupts` extension point emits the interrupt checks in a lexically delimited scope. For convenience, we offer the extension point `%global_debug_interrupts` which triggers emitting the interrupt checks in the remainder of the source preprocessed in the same process (its scope is therefore less well defined). For example: ```ocaml -module Debug_runtime = (val Minidebug_runtime.debug ()) +module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ()) [%%global_debug_interrupts { max_nesting_depth = 5; max_num_children = 10 }] @@ -342,7 +346,7 @@ For example: print_endline @@ Int.to_string @@ track_branches 3 ``` -gives: +gives (assuming `~values_first_mode:false`): ```shell BEGIN DEBUG SESSION @@ -395,7 +399,7 @@ To disable, rather than enhance, debugging for a piece of code, you can use the Explicit logging statements also help with tracking the execution, since they can be placed anywhere within a debug scope. Example from the test suite: ```ocaml - let module Debug_runtime = (val Minidebug_runtime.debug ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ()) in let%track_sexp result = let i = ref 0 in let j = ref 0 in @@ -454,7 +458,7 @@ The log levels are integers intended to be within the range 0-9, where 0 means n The `%diagn_` extension points further restrict logging to explicit logs only. Example from the test suite: ```ocaml - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in let%diagn_show bar { first : int; second : int } : int = let { first : int = a; second : int = b } = { first; second = second + 3 } in let y : int = a + 1 in @@ -503,7 +507,7 @@ At runtime, the level can be set via `Minidebug_runtime.debug ~log_level` or `Mi @@ Int.to_string (result Minidebug_runtime.( - forget_printbox @@ debug ~values_first_mode:true ~log_level:2 ~global_prefix:"Warning" ()) + forget_printbox @@ debug ~log_level:2 ~global_prefix:"Warning" ()) ()); ... ``` @@ -540,7 +544,7 @@ Another example from the test suite, notice how the log level of `%log1` overrid ```ocaml let module Debug_runtime = - (val Minidebug_runtime.debug ~values_first_mode:true ~log_level:2 ()) + (val Minidebug_runtime.debug ~log_level:2 ()) in let%debug3_show () = let foo { first : int; second : int } : int = @@ -590,7 +594,7 @@ The extension point `%log_result` lets you benefit from the `values_first_mode` The extension point `%log_printbox` lets you embed a `PrintBox.t` in the logs directly. Example from the test suite: ```ocaml - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in let%debug_show foo () : unit = [%log_printbox PrintBox.init_grid ~line:5 ~col:5 (fun ~line ~col -> @@ -654,7 +658,7 @@ The extension point `%log_printbox` lets you embed a `PrintBox.t` in the logs di The extension point `%log_entry` lets you shape arbitrary log tree structures. The similar extension point `%log_block` ensures that its body doesn't get executed (resp. generated) when the current runtime (resp. compile-time) log level is inadequate. Example: ```ocaml - let module Debug_runtime = (val Minidebug_runtime.debug ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ()) in let%diagn_show _logging_logic : unit = let logify _logs = [%log_block @@ -738,7 +742,7 @@ the runtime, and look for the path line with the log's entry id. When the backen ```ocaml let module Debug_runtime = - (val Minidebug_runtime.debug ~print_entry_ids:true ~values_first_mode:true ()) + (val Minidebug_runtime.debug ~print_entry_ids:true ()) in let i = 3 in let pi = 3.14 in @@ -813,7 +817,7 @@ The test suite example: print_endline @@ Int.to_string @@ fixpoint_changes 7 ``` -leads to: +leads to (assuming `~values_first_mode:false`): ```shell "test/test_expect_test.ml":96:43-100:58: fixpoint_changes @@ -839,7 +843,8 @@ The `no_debug_if` mechanism requires modifying the logged sources, and since it' Setting the option `truncate_children` will only log the given number of children at each node, prioritizing the most recent ones. An example from the test suite: ```ocaml - let module Debug_runtime = (val Minidebug_runtime.debug ~truncate_children:10 ()) in + let module Debug_runtime = + (val Minidebug_runtime.debug ~truncate_children:10 ~values_first_mode:false ()) in let () = let%track_show _bar : unit = for i = 0 to 30 do @@ -903,7 +908,7 @@ Example demonstrating foldable trees in Markdown: ```ocaml module Debug_runtime = (val Minidebug_runtime.debug_file ~elapsed_times:Microseconds ~hyperlink:"./" - ~backend:(`Markdown Minidebug_runtime.default_md_config) ~values_first_mode:true + ~backend:(`Markdown Minidebug_runtime.default_md_config) ~truncate_children:4 "debugger_sexp_time_spans") let sexp_of_int i = Sexplib0.Sexp.Atom (string_of_int i) @@ -1265,7 +1270,7 @@ Here is a probably incomplete list of the restrictions: As a help in debugging whether the right type information got propagated, we offer the extension `%debug_type_info` (and `%global_debug_type_info`). (The display strips module qualifiers from types.) `%debug_type_info` is not an entry extension point (`%global_debug_type_info` is). Example [from the test suite](test/test_expect_test.ml): ```ocaml - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in [%debug_show [%debug_type_info let f : 'a. 'a -> int -> int = fun _a b -> b + 1 in @@ -1349,7 +1354,7 @@ Example from the test suite: let () = print_endline @@ Int.to_string @@ foo - (Minidebug_runtime.debug ~global_prefix:"foo-1" ~values_first_mode:true ()) + (Minidebug_runtime.debug ~global_prefix:"foo-1" ()) [ 7 ] in let%track_rt_show baz : int list -> int = function @@ -1361,13 +1366,13 @@ Example from the test suite: let () = print_endline @@ Int.to_string @@ baz - Minidebug_runtime.(forget_printbox @@ debug ~global_prefix:"baz-1" ~values_first_mode:true ()) + Minidebug_runtime.(forget_printbox @@ debug ~global_prefix:"baz-1" ()) [ 4 ] in let () = print_endline @@ Int.to_string @@ baz - Minidebug_runtime.(forget_printbox @@ debug ~global_prefix:"baz-2" ~values_first_mode:true ()) + Minidebug_runtime.(forget_printbox @@ debug ~global_prefix:"baz-2" ()) [ 4; 5; 6 ] in [%expect diff --git a/minidebug_runtime.ml b/minidebug_runtime.ml index 6f559e4..448df7c 100644 --- a/minidebug_runtime.ml +++ b/minidebug_runtime.ml @@ -512,7 +512,7 @@ module PrintBox (Log_to : Shared_config) = struct prune_upto = 0; truncate_children = 0; exclude_on_path = None; - values_first_mode = false; + values_first_mode = true; max_inline_sexp_size = 20; max_inline_sexp_length = 80; snapshot_every_sec = None; @@ -1332,7 +1332,7 @@ let debug_file ?(time_tagged = Not_tagged) ?(elapsed_times = elapsed_default) ?(toc_entry = And []) ?(toc_flame_graph = false) ?(flame_graph_separation = 40) ?highlight_terms ?exclude_on_path ?(prune_upto = 0) ?(truncate_children = 0) ?(for_append = false) ?(boxify_sexp_from_size = 50) ?(max_inline_sexp_length = 80) - ?backend ?hyperlink ?toc_specific_hyperlink ?(values_first_mode = false) + ?backend ?hyperlink ?toc_specific_hyperlink ?(values_first_mode = true) ?(log_level = 9) ?snapshot_every_sec filename : (module PrintBox_runtime) = let filename = match backend with @@ -1371,7 +1371,7 @@ let debug ?debug_ch ?(time_tagged = Not_tagged) ?(elapsed_times = elapsed_defaul ?(location_format = Beg_pos) ?(print_entry_ids = false) ?(verbose_entry_ids = false) ?description ?(global_prefix = "") ?table_of_contents_ch ?(toc_entry = And []) ?highlight_terms ?exclude_on_path ?(prune_upto = 0) ?(truncate_children = 0) - ?toc_specific_hyperlink ?(values_first_mode = false) ?(log_level = 9) + ?toc_specific_hyperlink ?(values_first_mode = true) ?(log_level = 9) ?snapshot_every_sec () : (module PrintBox_runtime) = let module Debug = PrintBox (struct let refresh_ch () = false diff --git a/minidebug_runtime.mli b/minidebug_runtime.mli index cddce01..798e5ff 100644 --- a/minidebug_runtime.mli +++ b/minidebug_runtime.mli @@ -181,7 +181,7 @@ module type PrintBox_runtime = sig editor-specific prefixes such as ["vscode://file/"]. Note that rendering a link on a node will make the node non-foldable, - therefore it is best to combine [`prefix prefix] with [values_first_mode]. *) + therefore it is best to combine [`Prefix prefix] with [values_first_mode=true]. *) mutable toc_specific_hyperlink : string option; (** If provided, overrides [hyperlink] as the prefix used for generating URIs pointing to anchors in logs. *) diff --git a/test/debugger_sexp_html-toc.expected.html b/test/debugger_sexp_html-toc.expected.html index a7c13f4..94f7d48 100644 --- a/test/debugger_sexp_html-toc.expected.html +++ b/test/debugger_sexp_html-toc.expected.html @@ -1,10 +1,10 @@ -
"test/test_debug_html.ml":9:19: foo
+
-
"test/test_debug_html.ml":17:19: bar
+
-
"test/test_debug_html.ml":23:19: baz
+
-
"test/test_debug_html.ml":30:19: lab
+
-
"test/test_debug_html.ml":36:24: loop
+
diff --git a/test/debugger_sexp_html.expected.html b/test/debugger_sexp_html.expected.html index 9ec0418..c6a030a 100644 --- a/test/debugger_sexp_html.expected.html +++ b/test/debugger_sexp_html.expected.html @@ -1,12 +1,12 @@ BEGIN DEBUG SESSION -
+
 foo = (7 8 16)
-
+
 bar = 336
-
+
 baz = 359
-
+
 lab = (7 8 16)
-
+
 loop = 36
diff --git a/test/debugger_sexp_printbox.expected.log b/test/debugger_sexp_printbox.expected.log index aef4058..80b4648 100644 --- a/test/debugger_sexp_printbox.expected.log +++ b/test/debugger_sexp_printbox.expected.log @@ -1,45 +1,45 @@ BEGIN DEBUG SESSION -"test/test_debug_sexp.ml":7:19: foo +"test/test_debug_sexp.ml":9:19: foo ├─x = 7 -├─"test/test_debug_sexp.ml":8:6: y +├─"test/test_debug_sexp.ml":10:6: y │ └─y = 8 └─foo = (7 8 16) -"test/test_debug_sexp.ml":15:19: bar +"test/test_debug_sexp.ml":17:19: bar ├─x = ((first 7) (second 42)) -├─"test/test_debug_sexp.ml":16:6: y +├─"test/test_debug_sexp.ml":18:6: y │ └─y = 8 └─bar = 336 -"test/test_debug_sexp.ml":21:19: baz +"test/test_debug_sexp.ml":23:19: baz ├─x = ((first 7) (second 42)) -├─"test/test_debug_sexp.ml":22:17: _yz +├─"test/test_debug_sexp.ml":24:17: _yz │ └─_yz = (8 3) -├─"test/test_debug_sexp.ml":23:17: _uw +├─"test/test_debug_sexp.ml":25:17: _uw │ └─_uw = (7 13) └─baz = 359 -"test/test_debug_sexp.ml":28:19: lab +"test/test_debug_sexp.ml":30:19: lab ├─x = 7 -├─"test/test_debug_sexp.ml":29:6: y +├─"test/test_debug_sexp.ml":31:6: y │ └─y = 8 └─lab = (7 8 16) -"test/test_debug_sexp.ml":34:24: loop +"test/test_debug_sexp.ml":36:24: loop ├─depth = 0 ├─x = ((first 7) (second 42)) -├─"test/test_debug_sexp.ml":38:8: y -│ ├─"test/test_debug_sexp.ml":34:24: loop +├─"test/test_debug_sexp.ml":40:8: y +│ ├─"test/test_debug_sexp.ml":36:24: loop │ │ ├─depth = 1 │ │ ├─x = ((first 41) (second 9)) -│ │ ├─"test/test_debug_sexp.ml":38:8: y -│ │ │ ├─"test/test_debug_sexp.ml":34:24: loop +│ │ ├─"test/test_debug_sexp.ml":40:8: y +│ │ │ ├─"test/test_debug_sexp.ml":36:24: loop │ │ │ │ ├─depth = 2 │ │ │ │ ├─x = ((first 8) (second 43)) -│ │ │ │ ├─"test/test_debug_sexp.ml":34:24: loop +│ │ │ │ ├─"test/test_debug_sexp.ml":36:24: loop │ │ │ │ │ ├─depth = 3 │ │ │ │ │ ├─x = ((first 44) (second 4)) -│ │ │ │ │ ├─"test/test_debug_sexp.ml":34:24: loop +│ │ │ │ │ ├─"test/test_debug_sexp.ml":36:24: loop │ │ │ │ │ │ ├─depth = 4 │ │ │ │ │ │ ├─x = ((first 5) (second 22)) -│ │ │ │ │ │ ├─"test/test_debug_sexp.ml":34:24: loop +│ │ │ │ │ │ ├─"test/test_debug_sexp.ml":36:24: loop │ │ │ │ │ │ │ ├─depth = 5 │ │ │ │ │ │ │ ├─x = ((first 23) (second 2)) │ │ │ │ │ │ │ └─loop = 25 @@ -47,17 +47,17 @@ BEGIN DEBUG SESSION │ │ │ │ │ └─loop = 25 │ │ │ │ └─loop = 25 │ │ │ └─y = 25 -│ │ ├─"test/test_debug_sexp.ml":39:8: z -│ │ │ ├─"test/test_debug_sexp.ml":34:24: loop +│ │ ├─"test/test_debug_sexp.ml":41:8: z +│ │ │ ├─"test/test_debug_sexp.ml":36:24: loop │ │ │ │ ├─depth = 2 │ │ │ │ ├─x = ((first 10) (second 25)) -│ │ │ │ ├─"test/test_debug_sexp.ml":34:24: loop +│ │ │ │ ├─"test/test_debug_sexp.ml":36:24: loop │ │ │ │ │ ├─depth = 3 │ │ │ │ │ ├─x = ((first 26) (second 5)) -│ │ │ │ │ ├─"test/test_debug_sexp.ml":34:24: loop +│ │ │ │ │ ├─"test/test_debug_sexp.ml":36:24: loop │ │ │ │ │ │ ├─depth = 4 │ │ │ │ │ │ ├─x = ((first 6) (second 13)) -│ │ │ │ │ │ ├─"test/test_debug_sexp.ml":34:24: loop +│ │ │ │ │ │ ├─"test/test_debug_sexp.ml":36:24: loop │ │ │ │ │ │ │ ├─depth = 5 │ │ │ │ │ │ │ ├─x = ((first 14) (second 3)) │ │ │ │ │ │ │ └─loop = 17 @@ -67,21 +67,21 @@ BEGIN DEBUG SESSION │ │ │ └─z = 17 │ │ └─loop = 24 │ └─y = 24 -├─"test/test_debug_sexp.ml":39:8: z -│ ├─"test/test_debug_sexp.ml":34:24: loop +├─"test/test_debug_sexp.ml":41:8: z +│ ├─"test/test_debug_sexp.ml":36:24: loop │ │ ├─depth = 1 │ │ ├─x = ((first 43) (second 24)) -│ │ ├─"test/test_debug_sexp.ml":38:8: y -│ │ │ ├─"test/test_debug_sexp.ml":34:24: loop +│ │ ├─"test/test_debug_sexp.ml":40:8: y +│ │ │ ├─"test/test_debug_sexp.ml":36:24: loop │ │ │ │ ├─depth = 2 │ │ │ │ ├─x = ((first 23) (second 45)) -│ │ │ │ ├─"test/test_debug_sexp.ml":34:24: loop +│ │ │ │ ├─"test/test_debug_sexp.ml":36:24: loop │ │ │ │ │ ├─depth = 3 │ │ │ │ │ ├─x = ((first 46) (second 11)) -│ │ │ │ │ ├─"test/test_debug_sexp.ml":34:24: loop +│ │ │ │ │ ├─"test/test_debug_sexp.ml":36:24: loop │ │ │ │ │ │ ├─depth = 4 │ │ │ │ │ │ ├─x = ((first 12) (second 23)) -│ │ │ │ │ │ ├─"test/test_debug_sexp.ml":34:24: loop +│ │ │ │ │ │ ├─"test/test_debug_sexp.ml":36:24: loop │ │ │ │ │ │ │ ├─depth = 5 │ │ │ │ │ │ │ ├─x = ((first 24) (second 6)) │ │ │ │ │ │ │ └─loop = 30 @@ -89,17 +89,17 @@ BEGIN DEBUG SESSION │ │ │ │ │ └─loop = 30 │ │ │ │ └─loop = 30 │ │ │ └─y = 30 -│ │ ├─"test/test_debug_sexp.ml":39:8: z -│ │ │ ├─"test/test_debug_sexp.ml":34:24: loop +│ │ ├─"test/test_debug_sexp.ml":41:8: z +│ │ │ ├─"test/test_debug_sexp.ml":36:24: loop │ │ │ │ ├─depth = 2 │ │ │ │ ├─x = ((first 25) (second 30)) -│ │ │ │ ├─"test/test_debug_sexp.ml":34:24: loop +│ │ │ │ ├─"test/test_debug_sexp.ml":36:24: loop │ │ │ │ │ ├─depth = 3 │ │ │ │ │ ├─x = ((first 31) (second 12)) -│ │ │ │ │ ├─"test/test_debug_sexp.ml":34:24: loop +│ │ │ │ │ ├─"test/test_debug_sexp.ml":36:24: loop │ │ │ │ │ │ ├─depth = 4 │ │ │ │ │ │ ├─x = ((first 13) (second 15)) -│ │ │ │ │ │ ├─"test/test_debug_sexp.ml":34:24: loop +│ │ │ │ │ │ ├─"test/test_debug_sexp.ml":36:24: loop │ │ │ │ │ │ │ ├─depth = 5 │ │ │ │ │ │ │ ├─x = ((first 16) (second 6)) │ │ │ │ │ │ │ └─loop = 22 diff --git a/test/test_debug_md.ml b/test/test_debug_md.ml index be83d5b..87b524d 100644 --- a/test/test_debug_md.ml +++ b/test/test_debug_md.ml @@ -2,7 +2,7 @@ open Sexplib0.Sexp_conv module Debug_runtime = (val Minidebug_runtime.debug_file ~hyperlink:"../" - ~backend:(`Markdown Minidebug_runtime.default_md_config) ~values_first_mode:true + ~backend:(`Markdown Minidebug_runtime.default_md_config) "debugger_sexp_md") let%debug_sexp foo (x : int) : int list = diff --git a/test/test_debug_multifile.ml b/test/test_debug_multifile.ml index a2857b9..1a14d59 100644 --- a/test/test_debug_multifile.ml +++ b/test/test_debug_multifile.ml @@ -4,7 +4,7 @@ module Debug_runtime = (* Split as soon as possible. *) (val Minidebug_runtime.debug_file ~hyperlink:"../" ~split_files_after:(1 lsl 9) ~for_append:false ~backend:(`Markdown Minidebug_runtime.default_md_config) - ~values_first_mode:true "debugger_multifile") + "debugger_multifile") let%debug_sexp foo (x : int) : int list = let y : int = x + 1 in diff --git a/test/test_debug_sexp.expected.ml b/test/test_debug_sexp.expected.ml index aa60ae8..3f42925 100644 --- a/test/test_debug_sexp.expected.ml +++ b/test/test_debug_sexp.expected.ml @@ -1,19 +1,20 @@ open Sexplib0.Sexp_conv module Debug_runtime = (Minidebug_runtime.PrintBox)((val Minidebug_runtime.shared_config "debugger_sexp_printbox.log")) +let () = Debug_runtime.config.values_first_mode <- false let foo (x : int) = (let __entry_id = Debug_runtime.get_entry_id () in (); - (Debug_runtime.open_log ~fname:"test_debug_sexp.ml" ~start_lnum:7 - ~start_colnum:19 ~end_lnum:9 ~end_colnum:17 ~message:"foo" + (Debug_runtime.open_log ~fname:"test_debug_sexp.ml" ~start_lnum:9 + ~start_colnum:19 ~end_lnum:11 ~end_colnum:17 ~message:"foo" ~entry_id:__entry_id ~log_level:1 `Debug; Debug_runtime.log_value_sexp ?descr:(Some "x") ~entry_id:__entry_id ~log_level:1 ~is_result:false (([%sexp_of : int]) x)); (match let y : int = let __entry_id = Debug_runtime.get_entry_id () in (); - Debug_runtime.open_log ~fname:"test_debug_sexp.ml" ~start_lnum:8 - ~start_colnum:6 ~end_lnum:8 ~end_colnum:7 ~message:"y" + Debug_runtime.open_log ~fname:"test_debug_sexp.ml" ~start_lnum:10 + ~start_colnum:6 ~end_lnum:10 ~end_colnum:7 ~message:"y" ~entry_id:__entry_id ~log_level:1 `Debug; (match x + 1 with | y as __res -> @@ -22,11 +23,11 @@ let foo (x : int) = ~entry_id:__entry_id ~log_level:1 ~is_result:true (([%sexp_of : int]) y)); Debug_runtime.close_log ~fname:"test_debug_sexp.ml" - ~start_lnum:8 ~entry_id:__entry_id; + ~start_lnum:10 ~entry_id:__entry_id; __res) | exception e -> (Debug_runtime.close_log ~fname:"test_debug_sexp.ml" - ~start_lnum:8 ~entry_id:__entry_id; + ~start_lnum:10 ~entry_id:__entry_id; raise e)) in [x; y; 2 * y] with @@ -34,11 +35,11 @@ let foo (x : int) = (Debug_runtime.log_value_sexp ?descr:(Some "foo") ~entry_id:__entry_id ~log_level:1 ~is_result:true (([%sexp_of : int list]) __res); - Debug_runtime.close_log ~fname:"test_debug_sexp.ml" ~start_lnum:7 + Debug_runtime.close_log ~fname:"test_debug_sexp.ml" ~start_lnum:9 ~entry_id:__entry_id; __res) | exception e -> - (Debug_runtime.close_log ~fname:"test_debug_sexp.ml" ~start_lnum:7 + (Debug_runtime.close_log ~fname:"test_debug_sexp.ml" ~start_lnum:9 ~entry_id:__entry_id; raise e)) : int list) let () = ignore @@ (List.hd @@ (foo 7)) @@ -48,16 +49,16 @@ type t = { let bar (x : t) = (let __entry_id = Debug_runtime.get_entry_id () in (); - (Debug_runtime.open_log ~fname:"test_debug_sexp.ml" ~start_lnum:15 - ~start_colnum:19 ~end_lnum:17 ~end_colnum:14 ~message:"bar" + (Debug_runtime.open_log ~fname:"test_debug_sexp.ml" ~start_lnum:17 + ~start_colnum:19 ~end_lnum:19 ~end_colnum:14 ~message:"bar" ~entry_id:__entry_id ~log_level:1 `Debug; Debug_runtime.log_value_sexp ?descr:(Some "x") ~entry_id:__entry_id ~log_level:1 ~is_result:false (([%sexp_of : t]) x)); (match let y : int = let __entry_id = Debug_runtime.get_entry_id () in (); - Debug_runtime.open_log ~fname:"test_debug_sexp.ml" ~start_lnum:16 - ~start_colnum:6 ~end_lnum:16 ~end_colnum:7 ~message:"y" + Debug_runtime.open_log ~fname:"test_debug_sexp.ml" ~start_lnum:18 + ~start_colnum:6 ~end_lnum:18 ~end_colnum:7 ~message:"y" ~entry_id:__entry_id ~log_level:1 `Debug; (match x.first + 1 with | y as __res -> @@ -66,11 +67,11 @@ let bar (x : t) = ~entry_id:__entry_id ~log_level:1 ~is_result:true (([%sexp_of : int]) y)); Debug_runtime.close_log ~fname:"test_debug_sexp.ml" - ~start_lnum:16 ~entry_id:__entry_id; + ~start_lnum:18 ~entry_id:__entry_id; __res) | exception e -> (Debug_runtime.close_log ~fname:"test_debug_sexp.ml" - ~start_lnum:16 ~entry_id:__entry_id; + ~start_lnum:18 ~entry_id:__entry_id; raise e)) in x.second * y with @@ -78,27 +79,27 @@ let bar (x : t) = (Debug_runtime.log_value_sexp ?descr:(Some "bar") ~entry_id:__entry_id ~log_level:1 ~is_result:true (([%sexp_of : int]) __res); - Debug_runtime.close_log ~fname:"test_debug_sexp.ml" ~start_lnum:15 + Debug_runtime.close_log ~fname:"test_debug_sexp.ml" ~start_lnum:17 ~entry_id:__entry_id; __res) | exception e -> - (Debug_runtime.close_log ~fname:"test_debug_sexp.ml" ~start_lnum:15 + (Debug_runtime.close_log ~fname:"test_debug_sexp.ml" ~start_lnum:17 ~entry_id:__entry_id; raise e)) : int) let () = ignore @@ (bar { first = 7; second = 42 }) let baz (x : t) = (let __entry_id = Debug_runtime.get_entry_id () in (); - (Debug_runtime.open_log ~fname:"test_debug_sexp.ml" ~start_lnum:21 - ~start_colnum:19 ~end_lnum:24 ~end_colnum:28 ~message:"baz" + (Debug_runtime.open_log ~fname:"test_debug_sexp.ml" ~start_lnum:23 + ~start_colnum:19 ~end_lnum:26 ~end_colnum:28 ~message:"baz" ~entry_id:__entry_id ~log_level:1 `Debug; Debug_runtime.log_value_sexp ?descr:(Some "x") ~entry_id:__entry_id ~log_level:1 ~is_result:false (([%sexp_of : t]) x)); (match let (((y, z) as _yz) : (int * int)) = let __entry_id = Debug_runtime.get_entry_id () in (); - Debug_runtime.open_log ~fname:"test_debug_sexp.ml" ~start_lnum:22 - ~start_colnum:17 ~end_lnum:22 ~end_colnum:20 ~message:"_yz" + Debug_runtime.open_log ~fname:"test_debug_sexp.ml" ~start_lnum:24 + ~start_colnum:17 ~end_lnum:24 ~end_colnum:20 ~message:"_yz" ~entry_id:__entry_id ~log_level:1 `Debug; (match ((x.first + 1), 3) with | _yz as __res -> @@ -107,17 +108,17 @@ let baz (x : t) = ~entry_id:__entry_id ~log_level:1 ~is_result:true (([%sexp_of : (int * int)]) _yz)); Debug_runtime.close_log ~fname:"test_debug_sexp.ml" - ~start_lnum:22 ~entry_id:__entry_id; + ~start_lnum:24 ~entry_id:__entry_id; __res) | exception e -> (Debug_runtime.close_log ~fname:"test_debug_sexp.ml" - ~start_lnum:22 ~entry_id:__entry_id; + ~start_lnum:24 ~entry_id:__entry_id; raise e)) in let (((u, w) as _uw) : (int * int)) = let __entry_id = Debug_runtime.get_entry_id () in (); - Debug_runtime.open_log ~fname:"test_debug_sexp.ml" ~start_lnum:23 - ~start_colnum:17 ~end_lnum:23 ~end_colnum:20 ~message:"_uw" + Debug_runtime.open_log ~fname:"test_debug_sexp.ml" ~start_lnum:25 + ~start_colnum:17 ~end_lnum:25 ~end_colnum:20 ~message:"_uw" ~entry_id:__entry_id ~log_level:1 `Debug; (match (7, 13) with | _uw as __res -> @@ -126,11 +127,11 @@ let baz (x : t) = ~entry_id:__entry_id ~log_level:1 ~is_result:true (([%sexp_of : (int * int)]) _uw)); Debug_runtime.close_log ~fname:"test_debug_sexp.ml" - ~start_lnum:23 ~entry_id:__entry_id; + ~start_lnum:25 ~entry_id:__entry_id; __res) | exception e -> (Debug_runtime.close_log ~fname:"test_debug_sexp.ml" - ~start_lnum:23 ~entry_id:__entry_id; + ~start_lnum:25 ~entry_id:__entry_id; raise e)) in (((x.second * y) + z) + u) + w with @@ -138,27 +139,27 @@ let baz (x : t) = (Debug_runtime.log_value_sexp ?descr:(Some "baz") ~entry_id:__entry_id ~log_level:1 ~is_result:true (([%sexp_of : int]) __res); - Debug_runtime.close_log ~fname:"test_debug_sexp.ml" ~start_lnum:21 + Debug_runtime.close_log ~fname:"test_debug_sexp.ml" ~start_lnum:23 ~entry_id:__entry_id; __res) | exception e -> - (Debug_runtime.close_log ~fname:"test_debug_sexp.ml" ~start_lnum:21 + (Debug_runtime.close_log ~fname:"test_debug_sexp.ml" ~start_lnum:23 ~entry_id:__entry_id; raise e)) : int) let () = ignore @@ (baz { first = 7; second = 42 }) let lab ~x:(x : int) = (let __entry_id = Debug_runtime.get_entry_id () in (); - (Debug_runtime.open_log ~fname:"test_debug_sexp.ml" ~start_lnum:28 - ~start_colnum:19 ~end_lnum:30 ~end_colnum:17 ~message:"lab" + (Debug_runtime.open_log ~fname:"test_debug_sexp.ml" ~start_lnum:30 + ~start_colnum:19 ~end_lnum:32 ~end_colnum:17 ~message:"lab" ~entry_id:__entry_id ~log_level:1 `Debug; Debug_runtime.log_value_sexp ?descr:(Some "x") ~entry_id:__entry_id ~log_level:1 ~is_result:false (([%sexp_of : int]) x)); (match let y : int = let __entry_id = Debug_runtime.get_entry_id () in (); - Debug_runtime.open_log ~fname:"test_debug_sexp.ml" ~start_lnum:29 - ~start_colnum:6 ~end_lnum:29 ~end_colnum:7 ~message:"y" + Debug_runtime.open_log ~fname:"test_debug_sexp.ml" ~start_lnum:31 + ~start_colnum:6 ~end_lnum:31 ~end_colnum:7 ~message:"y" ~entry_id:__entry_id ~log_level:1 `Debug; (match x + 1 with | y as __res -> @@ -167,11 +168,11 @@ let lab ~x:(x : int) = ~entry_id:__entry_id ~log_level:1 ~is_result:true (([%sexp_of : int]) y)); Debug_runtime.close_log ~fname:"test_debug_sexp.ml" - ~start_lnum:29 ~entry_id:__entry_id; + ~start_lnum:31 ~entry_id:__entry_id; __res) | exception e -> (Debug_runtime.close_log ~fname:"test_debug_sexp.ml" - ~start_lnum:29 ~entry_id:__entry_id; + ~start_lnum:31 ~entry_id:__entry_id; raise e)) in [x; y; 2 * y] with @@ -179,19 +180,19 @@ let lab ~x:(x : int) = (Debug_runtime.log_value_sexp ?descr:(Some "lab") ~entry_id:__entry_id ~log_level:1 ~is_result:true (([%sexp_of : int list]) __res); - Debug_runtime.close_log ~fname:"test_debug_sexp.ml" ~start_lnum:28 + Debug_runtime.close_log ~fname:"test_debug_sexp.ml" ~start_lnum:30 ~entry_id:__entry_id; __res) | exception e -> - (Debug_runtime.close_log ~fname:"test_debug_sexp.ml" ~start_lnum:28 + (Debug_runtime.close_log ~fname:"test_debug_sexp.ml" ~start_lnum:30 ~entry_id:__entry_id; raise e)) : int list) let () = ignore @@ (List.hd @@ (lab ~x:7)) let rec loop (depth : int) (x : t) = (let __entry_id = Debug_runtime.get_entry_id () in (); - ((Debug_runtime.open_log ~fname:"test_debug_sexp.ml" ~start_lnum:34 - ~start_colnum:24 ~end_lnum:40 ~end_colnum:9 ~message:"loop" + ((Debug_runtime.open_log ~fname:"test_debug_sexp.ml" ~start_lnum:36 + ~start_colnum:24 ~end_lnum:42 ~end_colnum:9 ~message:"loop" ~entry_id:__entry_id ~log_level:1 `Debug; Debug_runtime.log_value_sexp ?descr:(Some "depth") ~entry_id:__entry_id ~log_level:1 ~is_result:false (([%sexp_of : int]) depth)); @@ -209,7 +210,7 @@ let rec loop (depth : int) (x : t) = let __entry_id = Debug_runtime.get_entry_id () in (); Debug_runtime.open_log ~fname:"test_debug_sexp.ml" - ~start_lnum:38 ~start_colnum:8 ~end_lnum:38 ~end_colnum:9 + ~start_lnum:40 ~start_colnum:8 ~end_lnum:40 ~end_colnum:9 ~message:"y" ~entry_id:__entry_id ~log_level:1 `Debug; (match loop (depth + 1) { first = (x.second - 1); second = (x.first + 2) } @@ -220,17 +221,17 @@ let rec loop (depth : int) (x : t) = ~entry_id:__entry_id ~log_level:1 ~is_result:true (([%sexp_of : int]) y)); Debug_runtime.close_log ~fname:"test_debug_sexp.ml" - ~start_lnum:38 ~entry_id:__entry_id; + ~start_lnum:40 ~entry_id:__entry_id; __res) | exception e -> (Debug_runtime.close_log ~fname:"test_debug_sexp.ml" - ~start_lnum:38 ~entry_id:__entry_id; + ~start_lnum:40 ~entry_id:__entry_id; raise e)) in let z : int = let __entry_id = Debug_runtime.get_entry_id () in (); Debug_runtime.open_log ~fname:"test_debug_sexp.ml" - ~start_lnum:39 ~start_colnum:8 ~end_lnum:39 ~end_colnum:9 + ~start_lnum:41 ~start_colnum:8 ~end_lnum:41 ~end_colnum:9 ~message:"z" ~entry_id:__entry_id ~log_level:1 `Debug; (match loop (depth + 1) { first = (x.second + 1); second = y } @@ -241,11 +242,11 @@ let rec loop (depth : int) (x : t) = ~entry_id:__entry_id ~log_level:1 ~is_result:true (([%sexp_of : int]) z)); Debug_runtime.close_log ~fname:"test_debug_sexp.ml" - ~start_lnum:39 ~entry_id:__entry_id; + ~start_lnum:41 ~entry_id:__entry_id; __res) | exception e -> (Debug_runtime.close_log ~fname:"test_debug_sexp.ml" - ~start_lnum:39 ~entry_id:__entry_id; + ~start_lnum:41 ~entry_id:__entry_id; raise e)) in z + 7) with @@ -253,11 +254,11 @@ let rec loop (depth : int) (x : t) = (Debug_runtime.log_value_sexp ?descr:(Some "loop") ~entry_id:__entry_id ~log_level:1 ~is_result:true (([%sexp_of : int]) __res); - Debug_runtime.close_log ~fname:"test_debug_sexp.ml" ~start_lnum:34 + Debug_runtime.close_log ~fname:"test_debug_sexp.ml" ~start_lnum:36 ~entry_id:__entry_id; __res) | exception e -> - (Debug_runtime.close_log ~fname:"test_debug_sexp.ml" ~start_lnum:34 + (Debug_runtime.close_log ~fname:"test_debug_sexp.ml" ~start_lnum:36 ~entry_id:__entry_id; raise e)) : int) let () = ignore @@ (loop 0 { first = 7; second = 42 }) diff --git a/test/test_debug_sexp.ml b/test/test_debug_sexp.ml index f2b870c..fb321cb 100644 --- a/test/test_debug_sexp.ml +++ b/test/test_debug_sexp.ml @@ -4,6 +4,8 @@ module Debug_runtime = Minidebug_runtime.PrintBox ((val Minidebug_runtime.shared_config "debugger_sexp_printbox.log")) +let () = Debug_runtime.config.values_first_mode <- false + let%debug_sexp foo (x : int) : int list = let y : int = x + 1 in [ x; y; 2 * y ] diff --git a/test/test_debug_time_spans.ml b/test/test_debug_time_spans.ml index 03b470f..c48e788 100644 --- a/test/test_debug_time_spans.ml +++ b/test/test_debug_time_spans.ml @@ -1,6 +1,6 @@ module Debug_runtime = (val Minidebug_runtime.debug_file ~elapsed_times:Microseconds ~hyperlink:"./" - ~backend:(`Markdown Minidebug_runtime.default_md_config) ~values_first_mode:true + ~backend:(`Markdown Minidebug_runtime.default_md_config) ~truncate_children:4 "debugger_sexp_time_spans") let sexp_of_int i = Sexplib0.Sexp.Atom (string_of_int i) diff --git a/test/test_expect_test.ml b/test/test_expect_test.ml index 61122f4..16a4fbf 100644 --- a/test/test_expect_test.ml +++ b/test/test_expect_test.ml @@ -191,7 +191,7 @@ let%expect_test "%debug_show flushing with global prefix" = |}] let%expect_test "%debug_show disabled subtree" = - let module Debug_runtime = (val Minidebug_runtime.debug ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ()) in let%debug_show rec loop_complete (x : int) : int = let z : int = (x - 1) / 2 in if x <= 0 then 0 else z + loop_complete (z + (x / 2)) @@ -271,7 +271,7 @@ let%expect_test "%debug_show disabled subtree" = |}] let%expect_test "%debug_show with exception" = - let module Debug_runtime = (val Minidebug_runtime.debug ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ()) in let%debug_show rec loop_truncated (x : int) : int = let z : int = (x - 1) / 2 in if x <= 0 then failwith "the log as for loop_complete but without return values"; @@ -320,7 +320,7 @@ let%expect_test "%debug_show with exception" = |}] let%expect_test "%debug_show depth exceeded" = - let module Debug_runtime = (val Minidebug_runtime.debug ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ()) in let%debug_show rec loop_exceeded (x : int) : int = [%debug_interrupts { max_nesting_depth = 5; max_num_children = 1000 }; @@ -358,7 +358,7 @@ let%expect_test "%debug_show depth exceeded" = |}] let%expect_test "%debug_show num children exceeded linear" = - let module Debug_runtime = (val Minidebug_runtime.debug ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ()) in let () = try let%debug_show _bar : unit = @@ -403,7 +403,7 @@ let%expect_test "%debug_show num children exceeded linear" = |}] let%expect_test "%debug_show truncated children linear" = - let module Debug_runtime = (val Minidebug_runtime.debug ~truncate_children:10 ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ~truncate_children:10 ()) in let () = try let%debug_show _bar : unit = @@ -442,7 +442,7 @@ let%expect_test "%debug_show truncated children linear" = |}] let%expect_test "%track_show track for-loop num children exceeded" = - let module Debug_runtime = (val Minidebug_runtime.debug ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ()) in let () = try let%track_show _bar : unit = @@ -487,7 +487,7 @@ let%expect_test "%track_show track for-loop num children exceeded" = |}] let%expect_test "%track_show track for-loop truncated children" = - let module Debug_runtime = (val Minidebug_runtime.debug ~truncate_children:10 ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ~truncate_children:10 ()) in let () = try let%track_show _bar : unit = @@ -529,7 +529,7 @@ let%expect_test "%track_show track for-loop truncated children" = |}] let%expect_test "%track_show track for-loop" = - let module Debug_runtime = (val Minidebug_runtime.debug ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ()) in let () = try let%track_show _bar : unit = @@ -580,7 +580,7 @@ let%expect_test "%track_show track for-loop" = |}] let%expect_test "%track_show track for-loop, time spans" = - let module Debug_runtime = (val Minidebug_runtime.debug ~elapsed_times:Microseconds ()) + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ~elapsed_times:Microseconds ()) in let () = try @@ -637,7 +637,7 @@ let%expect_test "%track_show track for-loop, time spans" = |}] let%expect_test "%track_show track while-loop" = - let module Debug_runtime = (val Minidebug_runtime.debug ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ()) in let () = try let%track_show _bar : unit = @@ -677,7 +677,7 @@ let%expect_test "%track_show track while-loop" = |}] let%expect_test "%debug_show num children exceeded nested" = - let module Debug_runtime = (val Minidebug_runtime.debug ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ()) in let%debug_show rec loop_exceeded (x : int) : int = [%debug_interrupts { max_nesting_depth = 1000; max_num_children = 10 }; @@ -734,7 +734,7 @@ let%expect_test "%debug_show num children exceeded nested" = |}] let%expect_test "%debug_show truncated children nested" = - let module Debug_runtime = (val Minidebug_runtime.debug ~truncate_children:4 ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ~truncate_children:4 ()) in let%debug_show rec loop_exceeded (x : int) : int = Array.fold_left ( + ) 0 @@ Array.init @@ -862,7 +862,7 @@ let%expect_test "%debug_show truncated children nested" = let%expect_test "%track_show highlight" = let module Debug_runtime = - (val Minidebug_runtime.debug ~highlight_terms:(Re.str "3") ()) + (val Minidebug_runtime.debug ~values_first_mode:false ~highlight_terms:(Re.str "3") ()) in let%debug_show rec loop_highlight (x : int) : int = [%debug_interrupts @@ -934,7 +934,7 @@ let%expect_test "%track_show highlight" = |}] let%expect_test "%track_show PrintBox tracking" = - let module Debug_runtime = (val Minidebug_runtime.debug ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ()) in let%track_show track_branches (x : int) : int = if x < 6 then match x with 0 -> 1 | 1 -> 0 | _ -> ~-x else match x with 6 -> 5 | 7 -> 4 | _ -> x @@ -963,7 +963,7 @@ let%expect_test "%track_show PrintBox tracking" = |}] let%expect_test "%track_show PrintBox tracking " = - let module Debug_runtime = (val Minidebug_runtime.debug ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ()) in let%track_show track_branches = function | 0 -> 1 | 1 -> 0 @@ -988,7 +988,7 @@ let%expect_test "%track_show PrintBox tracking " = |}] let%expect_test "%track_show PrintBox tracking with debug_notrace" = - let module Debug_runtime = (val Minidebug_runtime.debug ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ()) in let%track_show track_branches (x : int) : int = if x < 6 then match%debug_notrace x with @@ -1034,7 +1034,7 @@ let%expect_test "%track_show PrintBox tracking with debug_notrace" = let%expect_test "%track_show PrintBox not tracking anonymous functions with debug_notrace" = - let module Debug_runtime = (val Minidebug_runtime.debug ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ()) in let%track_show track_foo (x : int) : int = [%debug_notrace (fun (y : int) -> ignore y) x]; let w = [%debug_notrace (fun (v : int) -> v) x] in @@ -1057,7 +1057,7 @@ let%expect_test "%track_show PrintBox not tracking anonymous functions with debu |}] let%expect_test "respect scope of nested extension points" = - let module Debug_runtime = (val Minidebug_runtime.debug ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ()) in let%track_show track_branches (x : int) : int = if x < 6 then match%debug_notrace x with @@ -1101,7 +1101,7 @@ let%expect_test "respect scope of nested extension points" = |}] let%expect_test "%debug_show un-annotated toplevel fun" = - let module Debug_runtime = (val Minidebug_runtime.debug ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ()) in let%debug_show anonymous x = let nested y = y + 1 in [%log "We do log this function"]; @@ -1126,7 +1126,7 @@ let%expect_test "%debug_show un-annotated toplevel fun" = |}] let%expect_test "%debug_show nested un-annotated toplevel fun" = - let module Debug_runtime = (val Minidebug_runtime.debug ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ()) in let%debug_show wrapper () = let%debug_show anonymous x = let nested y = y + 1 in @@ -1155,7 +1155,7 @@ let%expect_test "%debug_show nested un-annotated toplevel fun" = |}] let%expect_test "%track_show no return type anonymous fun" = - let module Debug_runtime = (val Minidebug_runtime.debug ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ()) in let%debug_show anonymous (x : int) = Array.fold_left ( + ) 0 @@ Array.init (x + 1) (fun (i : int) -> i) in @@ -1193,7 +1193,7 @@ let%expect_test "%track_show no return type anonymous fun" = |}] let%expect_test "%track_show anonymous fun, num children exceeded" = - let module Debug_runtime = (val Minidebug_runtime.debug ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ()) in let%track_show rec loop_exceeded (x : int) : int = [%debug_interrupts { max_nesting_depth = 1000; max_num_children = 10 }; @@ -1289,7 +1289,7 @@ let%expect_test "%track_show anonymous fun, num children exceeded" = |}] let%expect_test "%track_show anonymous fun, truncated children" = - let module Debug_runtime = (val Minidebug_runtime.debug ~truncate_children:2 ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ~truncate_children:2 ()) in let%track_show rec loop_exceeded (x : int) : int = Array.fold_left ( + ) 0 @@ Array.init @@ -1347,7 +1347,7 @@ module type T = sig end let%expect_test "%debug_show function with abstract type" = - let module Debug_runtime = (val Minidebug_runtime.debug ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ()) in let%debug_show foo (type d) (module D : T with type c = d) ~a (c : int) : int = if c = 0 then 0 else List.length [ a; D.c ] in @@ -1373,7 +1373,7 @@ let%expect_test "%debug_show function with abstract type" = |}] let%expect_test "%debug_show PrintBox values_first_mode to stdout with exception" = - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in let%debug_show rec loop_truncated (x : int) : int = let z : int = (x - 1) / 2 in if x <= 0 then failwith "the log as for loop_complete but without return values"; @@ -1431,7 +1431,7 @@ let%expect_test "%debug_show PrintBox values_first_mode to stdout with exception let%expect_test "%debug_show PrintBox values_first_mode to stdout num children exceeded \ linear" = - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in let () = try let%debug_show _bar : unit = @@ -1477,7 +1477,7 @@ let%expect_test "%debug_show PrintBox values_first_mode to stdout num children e |}] let%expect_test "%track_show PrintBox values_first_mode to stdout track for-loop" = - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in let () = try let%track_show _bar : unit = @@ -1537,7 +1537,7 @@ let%expect_test "%track_show PrintBox values_first_mode to stdout track for-loop let%expect_test "%debug_show PrintBox values_first_mode to stdout num children exceeded \ nested" = - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in let%debug_show rec loop_exceeded (x : int) : int = [%debug_interrupts { max_nesting_depth = 1000; max_num_children = 10 }; @@ -1600,7 +1600,7 @@ let%expect_test "%debug_show PrintBox values_first_mode to stdout num children e let%expect_test "%debug_show elapsed times PrintBox values_first_mode to stdout nested, \ truncated children" = let module Debug_runtime = - (val Minidebug_runtime.debug ~elapsed_times:Microseconds ~values_first_mode:true + (val Minidebug_runtime.debug ~elapsed_times:Microseconds ~truncate_children:4 ()) in let%debug_show rec loop_exceeded (x : int) : int = @@ -1765,7 +1765,7 @@ let%expect_test "%debug_show elapsed times PrintBox values_first_mode to stdout let%expect_test "%debug_show PrintBox values_first_mode to stdout highlight" = let module Debug_runtime = - (val Minidebug_runtime.debug ~highlight_terms:(Re.str "3") ~values_first_mode:true ()) + (val Minidebug_runtime.debug ~highlight_terms:(Re.str "3") ()) in let%debug_show rec loop_highlight (x : int) : int = let z : int = (x - 1) / 2 in @@ -1833,7 +1833,7 @@ let%expect_test "%debug_show PrintBox values_first_mode to stdout highlight" = |}] let%expect_test "%track_show PrintBox values_first_mode tracking" = - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in let%track_show track_branches (x : int) : int = if x < 6 then match x with 0 -> 1 | 1 -> 0 | _ -> ~-x else match x with 6 -> 5 | 7 -> 4 | _ -> x @@ -1867,7 +1867,7 @@ let%expect_test "%track_show PrintBox values_first_mode tracking" = let%expect_test "%track_show PrintBox values_first_mode to stdout no return type \ anonymous fun" = - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in let%track_show anonymous (x : int) = Array.fold_left ( + ) 0 @@ Array.init (x + 1) (fun (i : int) -> i) in @@ -1975,7 +1975,7 @@ let%expect_test "%debug_show tuples" = |}] let%expect_test "%debug_show records values_first_mode" = - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in let%debug_show bar { first : int; second : int } : int = let { first : int = a; second : int = b } = { first; second = second + 3 } in let y : int = a + 1 in @@ -2015,7 +2015,7 @@ let%expect_test "%debug_show records values_first_mode" = |}] let%expect_test "%debug_show tuples values_first_mode" = - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in let%debug_show bar ((first : int), (second : int)) : int = let y : int = first + 1 in second * y @@ -2067,7 +2067,7 @@ type ('a, 'b) left_right = Left of 'a | Right of 'b type ('a, 'b, 'c) one_two_three = One of 'a | Two of 'b | Three of 'c let%expect_test "%track_show variants values_first_mode" = - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in let%track_show bar (Zero (x : int)) : int = let y = (x + 1 : int) in 2 * y @@ -2111,7 +2111,7 @@ let%expect_test "%track_show variants values_first_mode" = |}] let%expect_test "%debug_show tuples merge type info" = - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in let%debug_show baz (((first : int), (second : 'a)) : 'b * int) : int * int = let ((y : 'c), (z : int)) : int * 'd = (first + 1, 3) in let (a : int), b = (first + 1, (second + 3 : int)) in @@ -2145,7 +2145,7 @@ let%expect_test "%debug_show tuples merge type info" = |}] let%expect_test "%debug_show decompose multi-argument function type" = - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in let%debug_show f : 'a. 'a -> int -> int = fun _a b -> b + 1 in let%debug_show g : 'a. 'a -> int -> 'a -> 'a -> int = fun _a b _c _d -> b * 2 in let () = print_endline @@ Int.to_string @@ f 'a' 6 in @@ -2164,7 +2164,7 @@ let%expect_test "%debug_show decompose multi-argument function type" = |}] let%expect_test "%debug_show debug type info" = - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in [%debug_show [%debug_type_info let f : 'a. 'a -> int -> int = fun _a b -> b + 1 in @@ -2187,7 +2187,7 @@ let%expect_test "%debug_show debug type info" = |}] let%expect_test "%track_show options values_first_mode" = - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in let%track_show foo l : int = match (l : int option) with None -> 7 | Some y -> y * 2 in @@ -2232,7 +2232,7 @@ let%expect_test "%track_show options values_first_mode" = |}] let%expect_test "%track_show list values_first_mode" = - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in let%track_show foo l : int = match (l : int list) with [] -> 7 | y :: _ -> y * 2 in let () = print_endline @@ Int.to_string @@ foo [ 7 ] in let%track_show bar (l : int list) : int = match l with [] -> 7 | y :: _ -> y * 2 in @@ -2286,7 +2286,7 @@ let%expect_test "%track_rt_show list runtime passing" = print_endline @@ Int.to_string @@ foo Minidebug_runtime.( - forget_printbox @@ debug ~global_prefix:"foo-1" ~values_first_mode:true ()) + forget_printbox @@ debug ~global_prefix:"foo-1" ()) [ 7 ] in let%track_rt_show baz : int list -> int = function @@ -2299,14 +2299,14 @@ let%expect_test "%track_rt_show list runtime passing" = print_endline @@ Int.to_string @@ baz Minidebug_runtime.( - forget_printbox @@ debug ~global_prefix:"baz-1" ~values_first_mode:true ()) + forget_printbox @@ debug ~global_prefix:"baz-1" ()) [ 4 ] in let () = print_endline @@ Int.to_string @@ baz Minidebug_runtime.( - forget_printbox @@ debug ~global_prefix:"baz-2" ~values_first_mode:true ()) + forget_printbox @@ debug ~global_prefix:"baz-2" ()) [ 4; 5; 6 ] in [%expect @@ -2369,7 +2369,7 @@ let%expect_test "%track_rt_show procedure runtime passing" = |}] let%expect_test "%track_rt_show nested procedure runtime passing" = - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in let%debug_show rt_test () = let%track_rt_show bar () = (fun () -> ()) () in let%track_rt_show foo () = @@ -2409,7 +2409,7 @@ let%expect_test "%track_rt_show nested procedure runtime passing" = |}] let%expect_test "%log constant entries" = - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in let%debug_show foo () : unit = [%log "This is the first log line"]; [%log [ "This is the"; "2"; "log line" ]]; @@ -2445,7 +2445,7 @@ let%expect_test "%log constant entries" = |}] let%expect_test "%log with type annotations" = - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in let i = 3 in let pi = 3.14 in let l = [ 1; 2; 3 ] in @@ -2470,7 +2470,7 @@ let%expect_test "%log with type annotations" = |}] let%expect_test "%log with default type assumption" = - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in let s = "3" in let pi = "3.14" in let x2 s = "2*" ^ s in @@ -2497,7 +2497,7 @@ let%expect_test "%log with default type assumption" = |}] let%expect_test "%log track while-loop" = - let module Debug_runtime = (val Minidebug_runtime.debug ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ()) in let%track_sexp result = let i = ref 0 in let j = ref 0 in @@ -2560,28 +2560,28 @@ let%expect_test "%log runtime log levels while-loop" = print_endline @@ Int.to_string (result - Minidebug_runtime.(forget_printbox @@ debug ~global_prefix:"Everything" ()) + Minidebug_runtime.(forget_printbox @@ debug ~values_first_mode:false ~global_prefix:"Everything" ()) ()); print_endline @@ Int.to_string (result Minidebug_runtime.( forget_printbox - @@ debug ~values_first_mode:true ~log_level:0 ~global_prefix:"Nothing" ()) + @@ debug ~values_first_mode:false ~log_level:0 ~global_prefix:"Nothing" ()) ()); print_endline @@ Int.to_string (result Minidebug_runtime.( forget_printbox - @@ debug ~values_first_mode:true ~log_level:1 ~global_prefix:"Error" ()) + @@ debug ~log_level:1 ~global_prefix:"Error" ()) ()); print_endline @@ Int.to_string (result Minidebug_runtime.( forget_printbox - @@ debug ~values_first_mode:true ~log_level:2 ~global_prefix:"Warning" ()) + @@ debug ~log_level:2 ~global_prefix:"Warning" ()) ()); [%expect {| @@ -2724,7 +2724,7 @@ let%expect_test "%log runtime log levels while-loop" = |}] let%expect_test "%log compile time log levels while-loop" = - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in let%track_sexp everything () : int = [%log_level 9; @@ -2866,7 +2866,7 @@ let%expect_test "%log compile time log levels while-loop" = let%expect_test "%log compile time log levels runtime-passing while-loop" = let module Debug_runtime = - (val Minidebug_runtime.debug ~global_prefix:"TOPLEVEL" ~values_first_mode:true ()) + (val Minidebug_runtime.debug ~global_prefix:"TOPLEVEL" ()) in (* Compile-time log level restrictions cannot be undone, since the logging code is not generated. *) @@ -2889,7 +2889,7 @@ let%expect_test "%log compile time log levels runtime-passing while-loop" = print_endline @@ Int.to_string @@ nothing Minidebug_runtime.( - forget_printbox @@ debug ~global_prefix:"nothing" ~values_first_mode:true ()) + forget_printbox @@ debug ~global_prefix:"nothing" ()) ()]); [%log_level 2; @@ -2911,7 +2911,7 @@ let%expect_test "%log compile time log levels runtime-passing while-loop" = print_endline @@ Int.to_string @@ warning Minidebug_runtime.( - forget_printbox @@ debug ~global_prefix:"warning" ~values_first_mode:true ()) + forget_printbox @@ debug ~global_prefix:"warning" ()) ()] in [%expect @@ -2952,7 +2952,7 @@ let%expect_test "%log compile time log levels runtime-passing while-loop" = |}] let%expect_test "%log track while-loop result" = - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in let%track_sexp result = let i = ref 0 in let j = ref 0 in @@ -3008,7 +3008,7 @@ let%expect_test "%log track while-loop result" = |}] let%expect_test "%log without scope" = - let module Debug_runtime = (val Minidebug_runtime.debug ~print_entry_ids:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ~print_entry_ids:true ()) in let i = 3 in let pi = 3.14 in let l = [ 1; 2; 3 ] in @@ -3045,7 +3045,7 @@ let%expect_test "%log without scope" = let%expect_test "%log without scope values_first_mode" = let module Debug_runtime = - (val Minidebug_runtime.debug ~print_entry_ids:true ~values_first_mode:true ()) + (val Minidebug_runtime.debug ~print_entry_ids:true ()) in let i = 3 in let pi = 3.14 in @@ -3080,7 +3080,7 @@ let%expect_test "%log without scope values_first_mode" = let%expect_test "%log with print_entry_ids, mixed up scopes" = let module Debug_runtime = - (val Minidebug_runtime.debug ~print_entry_ids:true ~values_first_mode:true ()) + (val Minidebug_runtime.debug ~print_entry_ids:true ()) in let i = 3 in let pi = 3.14 in @@ -3140,7 +3140,7 @@ let%expect_test "%log with print_entry_ids, verbose_entry_ids in HTML, values_fi = let module Debug_runtime = (val Minidebug_runtime.debug ~print_entry_ids:true ~verbose_entry_ids:true - ~values_first_mode:true ()) + ()) in Debug_runtime.config.backend <- `Html PrintBox_html.Config.default; let i = 3 in @@ -3191,7 +3191,7 @@ let%expect_test "%log with print_entry_ids, verbose_entry_ids in HTML, values_fi |}] let%expect_test "%diagn_show ignores type annots" = - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in let%diagn_show toplevel = let bar { first : int; second : int } : int = let { first : int = a; second : int = b } = { first; second = second + 3 } in @@ -3220,7 +3220,7 @@ let%expect_test "%diagn_show ignores type annots" = |}] let%expect_test "%diagn_show ignores non-empty bindings" = - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in let%diagn_show bar { first : int; second : int } : int = let { first : int = a; second : int = b } = { first; second = second + 3 } in let y : int = a + 1 in @@ -3250,7 +3250,7 @@ let%expect_test "%diagn_show ignores non-empty bindings" = |}] let%expect_test "%diagn_show no logs" = - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in let%diagn_show bar { first : int; second : int } : int = let { first : int = a; second : int = b } = { first; second = second + 3 } in let y : int = a + 1 in @@ -3269,7 +3269,7 @@ let%expect_test "%diagn_show no logs" = |}] let%expect_test "%debug_show log level compile time" = - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in let%debug3_show () = [%log_level 2; @@ -3321,7 +3321,7 @@ let%expect_test "%debug_show log level compile time" = let%expect_test "%debug_show log level runtime" = let module Debug_runtime = - (val Minidebug_runtime.debug ~values_first_mode:true ~log_level:2 ()) + (val Minidebug_runtime.debug ~log_level:2 ()) in let%debug3_show () = let foo { first : int; second : int } : int = @@ -3368,7 +3368,7 @@ let%expect_test "%debug_show log level runtime" = |}] let%expect_test "%debug_show PrintBox snapshot" = - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in let%debug_show rec loop_highlight (x : int) : int = let z : int = (x - 1) / 2 in if z = 3 || x = 3 then Debug_runtime.snapshot (); @@ -3453,7 +3453,7 @@ let%expect_test "%debug_show PrintBox snapshot" = let%expect_test "%track_show don't show unannotated non-function bindings" = let module Debug_runtime = - (val Minidebug_runtime.debug ~values_first_mode:true ~log_level:3 ()) + (val Minidebug_runtime.debug ~log_level:3 ()) in let result = [%track_show @@ -3468,7 +3468,7 @@ let%expect_test "%track_show don't show unannotated non-function bindings" = BEGIN DEBUG SESSION |}] let%expect_test "%log_printbox" = - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in let%debug_show foo () : unit = [%log_printbox PrintBox.init_grid ~line:5 ~col:5 (fun ~line ~col -> @@ -3599,7 +3599,7 @@ let%expect_test "%log_printbox flushing" = |}] let%expect_test "%log_entry" = - let module Debug_runtime = (val Minidebug_runtime.debug ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ()) in let%diagn_show _logging_logic : unit = let rec loop logs = match logs with @@ -3653,7 +3653,7 @@ let%expect_test "%log_entry" = let%expect_test "flame graph" = let module Debug_runtime = - (val Minidebug_runtime.debug_file ~hyperlink:"../" ~toc_specific_hyperlink:"./" + (val Minidebug_runtime.debug_file ~values_first_mode:false ~hyperlink:"../" ~toc_specific_hyperlink:"./" ~toc_flame_graph:true ~backend:(`Html PrintBox_html.Config.(tree_summary true default)) "test_expect_test_flame_graph") @@ -3757,7 +3757,7 @@ let%expect_test "flame graph" = let%expect_test "flame graph reduced ToC" = let module Debug_runtime = - (val Minidebug_runtime.debug_file ~hyperlink:"../" ~toc_specific_hyperlink:"./" + (val Minidebug_runtime.debug_file ~values_first_mode:false ~hyperlink:"../" ~toc_specific_hyperlink:"./" ~toc_flame_graph:true ~toc_entry:(Minidebug_runtime.Minimal_depth 1) ~backend:(`Html PrintBox_html.Config.(tree_summary true default)) "test_expect_test_flame_graph") @@ -3849,7 +3849,7 @@ let%expect_test "flame graph reduced ToC" = let%expect_test "%debug_show skip module bindings" = let optional v thunk = match v with Some v -> v | None -> thunk () in - let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:true ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ()) in let%track_sexp bar ?(rt : (module Minidebug_runtime.Debug_runtime) option) (x : int) : int = let y : int = x + 1 in @@ -3959,7 +3959,7 @@ let%expect_test "%track_rt_show expression runtime passing" = [%log_block "test C"; [%log "line C"]]] - Minidebug_runtime.(forget_printbox @@ debug ~global_prefix:"t3" ~log_level:0 ()); + Minidebug_runtime.(forget_printbox @@ debug ~values_first_mode:false ~global_prefix:"t3" ~log_level:0 ()); [%expect {| BEGIN DEBUG SESSION t1 @@ -3978,7 +3978,7 @@ let%expect_test "%debug_show tuples values_first_mode highlighted" = let module Debug_runtime = (val Minidebug_runtime.debug ~highlight_terms:Re.(alt [ str "339"; str "8" ]) - ~values_first_mode:true ()) + ()) in let%debug_show bar ((first : int), (second : int)) : int = let y : int = first + 1 in @@ -4069,35 +4069,35 @@ let%expect_test "%logN_block runtime log levels" = @@ Int.to_string (result Minidebug_runtime.( - forget_printbox @@ debug ~global_prefix:"for=2,with=default" ()) + forget_printbox @@ debug ~values_first_mode:false ~global_prefix:"for=2,with=default" ()) ~for_log_level:2); print_endline @@ Int.to_string (result Minidebug_runtime.( forget_printbox - @@ debug ~values_first_mode:true ~log_level:0 ~global_prefix:"for=1,with=0" ()) + @@ debug ~log_level:0 ~global_prefix:"for=1,with=0" ()) ~for_log_level:1); print_endline @@ Int.to_string (result Minidebug_runtime.( forget_printbox - @@ debug ~values_first_mode:true ~log_level:1 ~global_prefix:"for=2,with=1" ()) + @@ debug ~log_level:1 ~global_prefix:"for=2,with=1" ()) ~for_log_level:2); print_endline @@ Int.to_string (result Minidebug_runtime.( forget_printbox - @@ debug ~values_first_mode:true ~log_level:2 ~global_prefix:"for=1,with=2" ()) + @@ debug ~log_level:2 ~global_prefix:"for=1,with=2" ()) ~for_log_level:1); print_endline @@ Int.to_string (result Minidebug_runtime.( forget_printbox - @@ debug ~values_first_mode:true ~log_level:3 ~global_prefix:"for=3,with=3" ()) + @@ debug ~log_level:3 ~global_prefix:"for=3,with=3" ()) ~for_log_level:3); (* Unlike with other constructs, INFO should not be printed in "for=4,with=3", because log_block filters out the whole body by the log level. *) @@ -4106,7 +4106,7 @@ let%expect_test "%logN_block runtime log levels" = (result Minidebug_runtime.( forget_printbox - @@ debug ~values_first_mode:true ~log_level:3 ~global_prefix:"for=4,with=3" ()) + @@ debug ~log_level:3 ~global_prefix:"for=4,with=3" ()) ~for_log_level:4); [%expect {| @@ -4321,7 +4321,7 @@ let%expect_test "%logN_block runtime log levels" = |}] let%expect_test "%log_block compile-time nothing" = - let module Debug_runtime = (val Minidebug_runtime.debug ()) in + let module Debug_runtime = (val Minidebug_runtime.debug ~values_first_mode:false ()) in let%diagn_show _logging_logic : unit = [%log_level 0;