From 812fe05b6b4abfbb0161562771636b2466746c88 Mon Sep 17 00:00:00 2001 From: alemi Date: Fri, 22 Mar 2024 17:54:49 +0100 Subject: [PATCH] fix: cleaner way to stop showing sqlx logs --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 740a4f9c..b2f6545d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -61,12 +61,13 @@ async fn main() { tracing_subscriber::fmt() .compact() .with_max_level(if args.debug { tracing::Level::DEBUG } else { tracing::Level::INFO }) - .with(tracing_subscriber::filter::filter_fn(|x| args.debug || x.target() != "sqlx::query")) .init(); + // TODO can i do connectoptions.into() or .connect() and skip these ugly bindings? let mut opts = ConnectOptions::new(&args.database); + opts - .max_connections(1); + .sqlx_logging_level(tracing::log::LevelFilter::Debug); let db = Database::connect(opts) .await.expect("error connecting to db");