Skip to content

Commit

Permalink
Merge pull request #168 from SeaQL/example/log
Browse files Browse the repository at this point in the history
Add example of debug log support
  • Loading branch information
tyt2y3 authored Sep 17, 2021
2 parents 905b7c4 + c1e399a commit 8564512
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions examples/tokio/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ publish = false
[dependencies]
sea-orm = { path = "../../", features = [ "sqlx-all", "runtime-tokio-native-tls" ] }
tokio = { version = "1", features = ["full"] }
env_logger = { version = "^0.9" }
log = { version = "^0.4" }
7 changes: 6 additions & 1 deletion examples/tokio/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ use sea_orm::*;

#[tokio::main]
pub async fn main() {
let db = Database::connect("sql://sea:sea@localhost/bakery")
env_logger::builder()
.filter_level(log::LevelFilter::Debug)
.is_test(true)
.init();

let db = Database::connect("mysql://sea:sea@localhost/bakery")
.await
.unwrap();

Expand Down

0 comments on commit 8564512

Please sign in to comment.