Skip to content

Commit

Permalink
chore: log examples with tracing-subscriber
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 committed Dec 23, 2021
1 parent 96a776a commit afcaa40
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions examples/actix4_example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ tera = "1.8.0"
dotenv = "0.15"
listenfd = "0.3.3"
serde = "1"
env_logger = "0.8"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

[dependencies.sea-orm]
path = "../../" # remove this line in your own project
version = "^0.4.0"
features = ["macros", "runtime-actix-native-tls"]
features = ["macros", "runtime-actix-native-tls", "debug-print"]
default-features = false

[features]
Expand Down
2 changes: 1 addition & 1 deletion examples/actix4_example/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ async fn delete(data: web::Data<AppState>, id: web::Path<i32>) -> Result<HttpRes
#[actix_web::main]
async fn main() -> std::io::Result<()> {
std::env::set_var("RUST_LOG", "debug");
env_logger::init();
tracing_subscriber::fmt::init();

// get env vars
dotenv::dotenv().ok();
Expand Down
4 changes: 2 additions & 2 deletions examples/actix_example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ tera = "1.8.0"
dotenv = "0.15"
listenfd = "0.3.3"
serde = "1"
env_logger = "0.8"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

[dependencies.sea-orm]
path = "../../" # remove this line in your own project
version = "^0.4.0"
features = ["macros", "runtime-async-std-native-tls"]
features = ["macros", "runtime-async-std-native-tls", "debug-print"]
default-features = false

[features]
Expand Down
2 changes: 1 addition & 1 deletion examples/actix_example/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ async fn delete(
#[actix_web::main]
async fn main() -> std::io::Result<()> {
std::env::set_var("RUST_LOG", "debug");
env_logger::init();
tracing_subscriber::fmt::init();

// get env vars
dotenv::dotenv().ok();
Expand Down
4 changes: 2 additions & 2 deletions examples/axum_example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ tower-http = { version = "0.2", features = ["fs"] }
tower-cookies = { version = "0.4" }
anyhow = "1"
dotenv = "0.15"
env_logger = "0.9"
serde = "1"
serde_json = "1"
tera = "1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

[dependencies.sea-orm]
path = "../../" # remove this line in your own project
version = "^0.4.2"
features = ["macros", "runtime-tokio-native-tls"]
features = ["macros", "runtime-tokio-native-tls", "debug-print"]
default-features = false

[features]
Expand Down
2 changes: 1 addition & 1 deletion examples/axum_example/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use tower_http::services::ServeDir;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
env::set_var("RUST_LOG", "debug");
env_logger::init();
tracing_subscriber::fmt::init();

dotenv::dotenv().ok();
let db_url = env::var("DATABASE_URL").expect("DATABASE_URL is not set in .env file");
Expand Down

0 comments on commit afcaa40

Please sign in to comment.