mirror of
https://github.com/LukeMathWalker/zero-to-production.git
synced 2025-01-22 06:48:06 +00:00
Lower level of sqxl's logs.
This commit is contained in:
parent
0c2833defd
commit
39cb4c5973
3 changed files with 6 additions and 1 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -2630,6 +2630,7 @@ dependencies = [
|
||||||
"claim",
|
"claim",
|
||||||
"config",
|
"config",
|
||||||
"fake",
|
"fake",
|
||||||
|
"log",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"quickcheck",
|
"quickcheck",
|
||||||
"quickcheck_macros",
|
"quickcheck_macros",
|
||||||
|
|
|
@ -20,6 +20,7 @@ config = { version = "0.10.1", default-features = false, features = ["yaml"] }
|
||||||
sqlx = { version = "0.5.5", default-features = false, features = [ "runtime-actix-rustls", "macros", "postgres", "uuid", "chrono", "migrate", "offline"] }
|
sqlx = { version = "0.5.5", default-features = false, features = [ "runtime-actix-rustls", "macros", "postgres", "uuid", "chrono", "migrate", "offline"] }
|
||||||
uuid = { version = "0.8.1", features = ["v4"] }
|
uuid = { version = "0.8.1", features = ["v4"] }
|
||||||
chrono = "0.4.15"
|
chrono = "0.4.15"
|
||||||
|
log = "0.4"
|
||||||
tracing = "0.1.19"
|
tracing = "0.1.19"
|
||||||
tracing-futures = "0.2.4"
|
tracing-futures = "0.2.4"
|
||||||
tracing-subscriber = { version = "0.2.12", features = ["registry", "env-filter"] }
|
tracing-subscriber = { version = "0.2.12", features = ["registry", "env-filter"] }
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
use serde_aux::field_attributes::deserialize_number_from_string;
|
use serde_aux::field_attributes::deserialize_number_from_string;
|
||||||
use sqlx::postgres::{PgConnectOptions, PgSslMode};
|
use sqlx::postgres::{PgConnectOptions, PgSslMode};
|
||||||
|
use sqlx::ConnectOptions;
|
||||||
use std::convert::{TryFrom, TryInto};
|
use std::convert::{TryFrom, TryInto};
|
||||||
|
|
||||||
#[derive(serde::Deserialize)]
|
#[derive(serde::Deserialize)]
|
||||||
|
@ -42,7 +43,9 @@ impl DatabaseSettings {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn with_db(&self) -> PgConnectOptions {
|
pub fn with_db(&self) -> PgConnectOptions {
|
||||||
self.without_db().database(&self.database_name)
|
let mut options = self.without_db().database(&self.database_name);
|
||||||
|
options.log_statements(log::LevelFilter::Trace);
|
||||||
|
options
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue