:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
/// Logs at `info!` level with "CHATTY: " prefix when enabled, otherwise `debug!` level.
/// Accepts the same syntax as tracing macros: `debug_or_info!(flag, field=?value, "message")`
#[macro_export]
macro_rules! debug_or_info {
($enabled:expr, $($args:tt)+) => {
$crate::debug_or_info!(@parse $enabled, [] $($args)+)
};
(@parse $enabled:expr, [$($fields:tt)*] $msg:literal) => {
if $enabled {
::tracing::info!($($fields)* concat!("CHATTY: ", $msg));
} else {
::tracing::debug!($($fields)* $msg);
}
};
(@parse $enabled:expr, [$($fields:tt)*] $next:tt $($rest:tt)+) => {
$crate::debug_or_info!(@parse $enabled, [$($fields)* $next] $($rest)+)
};
}