Skip to content

Commit

Permalink
chore: log [cli] with tracing-subscriber
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 committed Dec 23, 2021
1 parent 6b72b7f commit 9bebdcf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions sea-orm-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ sea-schema = { version = "0.3.0", default-features = false, features = [
"writer",
] }
sqlx = { version = "^0.5", default-features = false, features = [ "mysql", "postgres" ] }
env_logger = { version = "^0.9" }
log = { version = "^0.4" }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tracing = { version = "0.1" }
url = "^2.2"

[dev-dependencies]
Expand Down
6 changes: 3 additions & 3 deletions sea-orm-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ async fn run_generate_command(matches: &ArgMatches<'_>) -> Result<(), Box<dyn Er
let expanded_format = args.is_present("EXPANDED_FORMAT");
let with_serde = args.value_of("WITH_SERDE").unwrap();
if args.is_present("VERBOSE") {
let _ = ::env_logger::builder()
.filter_level(LevelFilter::Debug)
.is_test(true)
let _ = tracing_subscriber::fmt()
.with_max_level(tracing::Level::DEBUG)
.with_test_writer()
.try_init();
}

Expand Down

0 comments on commit 9bebdcf

Please sign in to comment.