Skip to main content

openlogi_core/
env.rs

1//! The environment variables OpenLogi reads at runtime.
2//!
3//! Named here once because more than one place reads them — the agent, the
4//! GUI, the overlay, the CLI, and the mock agent — and a knob spelled
5//! differently in one of them is a knob that silently does nothing there.
6//! Build-time knobs (`option_env!` in the updater) and the packaging overrides
7//! `xtask` reads belong to the one place that reads them.
8
9/// Forces the profile a process runs under, `dev` or `prod`; see
10/// [`Profile`](crate::paths::Profile) for what that decides. Unset, the
11/// profile is detected from the bundle the executable lives in.
12pub const PROFILE: &str = "OPENLOGI_PROFILE";
13
14/// The `tracing` filter every process installs, in `EnvFilter` directive
15/// syntax (`hidpp=trace`, `openlogi_agent=debug,info`, …).
16pub const LOG: &str = "OPENLOGI_LOG";
17
18/// What every process logs when [`LOG`] is unset.
19pub const LOG_DEFAULT: &str = "info";
20
21/// An asset mirror that overrides the configured source, for the GUI's asset
22/// sync and the CLI's `assets sync`.
23pub const ASSETS: &str = "OPENLOGI_ASSETS";
24
25/// Pins the GUI's device renders to one depot regardless of what is attached
26/// — a development convenience read in two places.
27pub const FORCE_DEPOT: &str = "OPENLOGI_FORCE_DEPOT";