1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/// Resolve a boolean env var with one consistent truthiness rule across the
/// crate (report 07 F12): `"1"`/`"true"` (case-insensitive) is true,
/// anything else present (including `"0"`/`"false"`/empty string) or absent
/// is false. Previously this repo had three different ad-hoc conventions in
/// three places: `"true"/"1"` (the dead `config_loader`), `"1"` only
/// (Python's `APHRODITE_CONTEXT_ENGINE` check), and presence-only
/// (`APHRODITE_LOG_COMPACT=0` used to still enable compact logging, since
/// `.is_ok()` doesn't look at the value at all).
/// Parse a present env var, warning (not silently defaulting) if it fails to
/// parse as `T` - the bug class `Maintain/examples/01_env_var_typo.py`
/// documents and `MultiConfig::apply_port_override`'s comment explains
/// (report 07 F10/F15): a missing var is the unremarkable common case, but a
/// *present-and-malformed* one left an operator with no way to tell "my
/// override didn't apply" from "I didn't set an override". Single shared
/// implementation so every numeric env-var read in the crate uses the same
/// rule (report 07 ยง7 generalization note).