Skip to content

Commit

Permalink
docs: debug log (SeaQL/sea-orm#373)
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 committed Dec 23, 2021
1 parent ac6d49e commit cf7f61d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions SeaORM/docs/02-install-and-config/04-debug-log.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Debug Log

SeaORM (with `debug-print` feature turned on) and SQLx both log debug messages via the [`log`](https://crates.io/crates/log) crate.
SeaORM (with `debug-print` feature turned on) log debug messages via the [`tracing`](https://crates.io/crates/tracing) crate.

You need to choose one of the [logging implementations](https://docs.rs/log/0.4.14/log/#available-logging-implementations) to capture and view the debug log. To use [`env_logger`](https://crates.io/crates/env_logger), see the snippet below and a complete example [here](https://github.com/SeaQL/sea-orm/blob/master/examples/tokio/src/main.rs).
You need to setup [`tracing-subscriber`](https://crates.io/crates/tracing-subscriber) to capture and view the debug log. See the snippet below and a complete example [here](https://github.com/SeaQL/sea-orm/blob/master/examples/actix_example/src/main.rs).

```rust
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();

// ...
Expand Down

0 comments on commit cf7f61d

Please sign in to comment.