fix: less noisy errors, slow query filter maybe
This commit is contained in:
parent
3c50dba3f8
commit
d3750ea8af
3 changed files with 3 additions and 2 deletions
|
@ -83,7 +83,7 @@ impl axum::response::IntoResponse for UpubError {
|
|||
fn into_response(self) -> axum::response::Response {
|
||||
// TODO it's kind of jank to hide this print down here, i should probably learn how spans work
|
||||
// in tracing and use the library's features but ehhhh
|
||||
tracing::error!("{self:?}");
|
||||
tracing::debug!("emitting error response: {self:?}");
|
||||
match self {
|
||||
UpubError::Redirect(to) => Redirect::to(&to).into_response(),
|
||||
UpubError::Status(status) => status.into_response(),
|
||||
|
|
|
@ -98,7 +98,7 @@ async fn main() {
|
|||
.acquire_timeout(std::time::Duration::from_secs(config.datasource.acquire_timeout_seconds))
|
||||
.connect_timeout(std::time::Duration::from_secs(config.datasource.connect_timeout_seconds))
|
||||
.sqlx_slow_statements_logging_settings(
|
||||
if config.datasource.slow_query_warn_enable { tracing::log::LevelFilter::Warn } else { tracing::log::LevelFilter::Off },
|
||||
if config.datasource.slow_query_warn_enable { tracing::log::LevelFilter::Warn } else { tracing::log::LevelFilter::Debug },
|
||||
std::time::Duration::from_secs(config.datasource.slow_query_warn_seconds)
|
||||
);
|
||||
|
||||
|
|
|
@ -75,4 +75,5 @@ impl SideEffects for super::Context {
|
|||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue