Skip to content

Commit

Permalink
Warning about %%global_debug_log_level_from_env_var
Browse files Browse the repository at this point in the history
  • Loading branch information
lukstafi committed Jun 1, 2024
1 parent f622259 commit c10c4cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,7 @@ There's also a way to compile the code adaptively, using a shell environment var
- `everything`: translates to `Everything`
- `` (empty): no change
**BEWARE**: using `%%global_debug_log_level_from_env_var` is very prone to workflow bugs where different parts of a codebase are compiled with different log levels, leading to very confusing behavior.
With some "abuse of notation", we use `Prefixed [||]` resp. `Prefixed_or_result [||]` to mean all-and-only explicit logs (resp. also result logs). `Prefixed [||]` only works at compile time. `Prefixed_or_result [||]` works as intended when set both at compile time and at runtime: then, it will output all explicit logs, but also results in otherwise-nonempty entries. Example from the test suite:
Expand Down
2 changes: 2 additions & 0 deletions index.mld
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,8 @@ There's also a way to compile the code adaptively, using a shell environment var
}{- `` (empty): no change
}}

{b BEWARE}: using [%%global_debug_log_level_from_env_var] is very prone to workflow bugs where different parts of a codebase are compiled with different log levels, leading to very confusing behavior.

With some "abuse of notation", we use [Prefixed [||]] resp. [Prefixed_or_result [||]] to mean all-and-only explicit logs (resp. also result logs). [Prefixed [||]] only works at compile time. [Prefixed_or_result [||]] works as intended when set both at compile time and at runtime: then, it will output all explicit logs, but also results in otherwise-nonempty entries. Example from the test suite:

{@ocaml[
Expand Down

0 comments on commit c10c4cd

Please sign in to comment.