From 6b72b7fdc5134bd2cf82169b17c5e1b9e0e502de Mon Sep 17 00:00:00 2001 From: Billy Chan Date: Thu, 23 Dec 2021 15:44:50 +0800 Subject: [PATCH] chore: log [issues] with tracing-subscriber --- issues/86/Cargo.toml | 4 ++-- issues/86/src/main.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/issues/86/Cargo.toml b/issues/86/Cargo.toml index 4284cb686..f5749a63f 100644 --- a/issues/86/Cargo.toml +++ b/issues/86/Cargo.toml @@ -10,5 +10,5 @@ publish = false [dependencies] sea-orm = { path = "../../", features = [ "sqlx-all", "runtime-tokio-native-tls", "debug-print" ] } tokio = { version = "1", features = ["full"] } -env_logger = { version = "^0.9" } -log = { version = "^0.4" } +tracing-subscriber = { version = "0.3", features = ["env-filter"] } +tracing = { version = "0.1" } diff --git a/issues/86/src/main.rs b/issues/86/src/main.rs index 14a76086c..21681287c 100644 --- a/issues/86/src/main.rs +++ b/issues/86/src/main.rs @@ -3,9 +3,9 @@ use sea_orm::*; #[tokio::main] pub async fn main() { - env_logger::builder() - .filter_level(log::LevelFilter::Debug) - .is_test(true) + tracing_subscriber::fmt() + .with_max_level(tracing::Level::DEBUG) + .with_test_writer() .init(); let db = Database::connect("mysql://sea:sea@localhost/bakery")