Mountain/Binary/Build/PostHogPlugin/CaptureAllowed.rs
1#![allow(non_snake_case)]
2
3//! Capture gate. Combines the compile-time `debug_assertions` check with
4//! the `Report` env-var switch baked at build time. Cheap early-exit
5//! consulted by every capture path.
6
7use crate::Binary::Build::PostHogPlugin::Constants;
8
9pub fn Fn() -> bool {
10 if !cfg!(debug_assertions) {
11 return false;
12 }
13 !matches!(Constants::POSTHOG_ENABLED, "false" | "0" | "off")
14}