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
38
39
40
41
//! Opt-in debug diagnostics, controlled by the `SPARSEIR_DEBUG` environment
//! variable.
use OsStr;
/// Environment variable that enables debug diagnostics.
const DEBUG_ENV_VAR: &str = "SPARSEIR_DEBUG";
/// Values of [`DEBUG_ENV_VAR`] that enable debug diagnostics, compared ASCII
/// case-insensitively. pylibsparseir accepts the same values.
const ENABLED_VALUES: = ;
/// Returns `true` if the `SPARSEIR_DEBUG` environment variable enables debug
/// diagnostics.
///
/// Debug diagnostics are enabled only when `SPARSEIR_DEBUG` is `1`, `true`,
/// `yes` or `on`, in any letter case, the same values pylibsparseir accepts.
/// Any other value, including `0`, `false`, an empty string, or an accepted
/// value with surrounding whitespace, leaves them disabled, as does an unset
/// variable.
///
/// The variable is read on every call. [`debug_warn!`](crate::debug_warn!)
/// and the debug macros of `sparse-ir-capi` all use this function.
/// Whether a value of `SPARSEIR_DEBUG` (`None` if the variable is unset)
/// enables debug diagnostics.