mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-04-16 17:34:33 +00:00
Log queries from sqlx::query
This will make logged queries show as from `sqlx::query` instead of `sqlx::db_name::executor`. Followup to #268
This commit is contained in:
committed by
Austin Bonander
parent
38892c1012
commit
627d8292f8
@@ -8,6 +8,7 @@ macro_rules! log_execution {
|
||||
let elapsed = timer.elapsed();
|
||||
if elapsed >= std::time::Duration::from_secs(1) {
|
||||
log::warn!(
|
||||
target: "sqlx::query",
|
||||
"{} ..., elapsed: {:.3?}\n\n{}\n",
|
||||
crate::logging::parse_query_summary(query_string),
|
||||
elapsed,
|
||||
@@ -19,6 +20,7 @@ macro_rules! log_execution {
|
||||
);
|
||||
} else {
|
||||
log::debug!(
|
||||
target: "sqlx::query",
|
||||
"{} ..., elapsed: {:.3?}\n\n{}\n",
|
||||
crate::logging::parse_query_summary(query_string),
|
||||
elapsed,
|
||||
|
||||
Reference in New Issue
Block a user