Lower level of sqxl's logs.

This commit is contained in:
LukeMathWalker 2021-09-30 21:13:14 +01:00
parent 0c2833defd
commit 39cb4c5973
3 changed files with 6 additions and 1 deletions

1
Cargo.lock generated
View file

@ -2630,6 +2630,7 @@ dependencies = [
"claim",
"config",
"fake",
"log",
"once_cell",
"quickcheck",
"quickcheck_macros",

View file

@ -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"] }
uuid = { version = "0.8.1", features = ["v4"] }
chrono = "0.4.15"
log = "0.4"
tracing = "0.1.19"
tracing-futures = "0.2.4"
tracing-subscriber = { version = "0.2.12", features = ["registry", "env-filter"] }

View file

@ -1,5 +1,6 @@
use serde_aux::field_attributes::deserialize_number_from_string;
use sqlx::postgres::{PgConnectOptions, PgSslMode};
use sqlx::ConnectOptions;
use std::convert::{TryFrom, TryInto};
#[derive(serde::Deserialize)]
@ -42,7 +43,9 @@ impl DatabaseSettings {
}
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
}
}