From 3b7951154fb67a16089b0d7e83fc3fa9fb1a6388 Mon Sep 17 00:00:00 2001 From: alemidev Date: Sun, 22 Jan 2023 17:03:33 +0100 Subject: [PATCH] fix: attempt at making logging less spammy --- src/main.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index f6c9316..f7a0219 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,8 +9,10 @@ use clap::Parser; use axum::{Router, routing::{get, post}, response::IntoResponse, Json, http::StatusCode, extract::State}; use sea_orm::{EntityTrait, DatabaseConnection, Database, ActiveValue::NotSet, Set}; use tokio::sync::Mutex; +use tracing_subscriber::filter::filter_fn; use uuid::Uuid; -use tracing::info; +use tracing_subscriber::prelude::*; +use tracing::{info, metadata::LevelFilter}; use crate::routes::{ auth::{authenticate, validate, refresh}, @@ -54,7 +56,10 @@ pub struct AppState { #[tokio::main] async fn main() -> Result<(), Box> { - tracing_subscriber::fmt::init(); + tracing_subscriber::registry() + .with(LevelFilter::INFO) + .with(filter_fn(|x| x.target() != "sqlx::query")) + .init(); let cfg = ConfigArgs::parse();