insights-correlations (#22)
Some checks failed
CI / Check / Test (push) Has been cancelled

Reviewed-on: #22
This commit was merged in pull request #22.
This commit is contained in:
2026-10-12 18:56:55 +00:00
parent 4d221e60de
commit e303ae7f08
139 changed files with 2371 additions and 696 deletions

View File

@@ -218,6 +218,7 @@ async fn wire_dependencies() -> anyhow::Result<(AppState, axum::Router)> {
federation_admin: Arc::new(domain::ports::noop::NoopFederationAdminQuery),
wrapup_stats: db.wrapup_stats,
wrapup_repo: db.wrapup_repo,
insights: db.insights,
goal_command: db.goal_command,
goal_query: db.goal_query,
user_settings: db.user_settings,
@@ -312,9 +313,23 @@ async fn create_event_publisher(
fn init_tracing() {
tracing_subscriber::registry()
.with(tracing_subscriber::EnvFilter::new(
std::env::var("RUST_LOG").unwrap_or_else(|_| "server=debug,tower_http=debug".into()),
))
.with(log_filter("server=debug,tower_http=debug"))
.with(tracing_subscriber::fmt::layer())
.init();
}
/// `RUST_LOG` names the crates to trace in detail; anything it doesn't name
/// still reports warnings and errors. Without a baseline, a filter like
/// `presentation=debug` silently drops adapter errors (e.g. the sqlx detail
/// behind "Database operation failed").
fn log_filter(default: &str) -> tracing_subscriber::EnvFilter {
let directives = std::env::var("RUST_LOG").unwrap_or_else(|_| default.to_string());
let has_baseline = directives
.split(',')
.any(|d| !d.trim().is_empty() && !d.contains('='));
if has_baseline {
tracing_subscriber::EnvFilter::new(directives)
} else {
tracing_subscriber::EnvFilter::new(format!("warn,{directives}"))
}
}