swarmy 0.2.12

Real-time analytics dashboard for coding agents (Claude Code, Antigravity, Codex): live swarm, history, API-equivalent spend, weekly limits, and a vault for OAuth logins
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! The debug channel: `SWARMY_DEBUG=1 swarmy … 2>log`. Failures that a front end does not show
//! (a file that could not be read where a fallback is harmless, a best-effort cleanup) are
//! written here instead of vanishing, so a wrong number can be traced back to its cause.

/// Whether `SWARMY_DEBUG` is set (read once).
pub fn enabled() -> bool {
    static D: std::sync::OnceLock<bool> = std::sync::OnceLock::new();
    *D.get_or_init(|| std::env::var_os("SWARMY_DEBUG").is_some())
}

/// One line on stderr when the debug channel is on: `swarmy[<area>]: <message>`.
pub fn log(area: &str, message: &str) {
    if enabled() {
        eprintln!("swarmy[{area}]: {message}");
    }
}