mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-03 04:09:50 +00:00
Add a way to disable query logging programmatically
This commit is contained in:
parent
63bbd3445b
commit
24c85d20d6
@ -166,4 +166,10 @@ pub trait ConnectOptions: 'static + Send + Sync + FromStr<Err = Error> + Debug {
|
||||
/// Log executed statements with a duration above the specified `duration`
|
||||
/// at the specified `level`.
|
||||
fn log_slow_statements(&mut self, level: LevelFilter, duration: Duration) -> &mut Self;
|
||||
|
||||
/// Entirely disables statement logging (both slow and regular).
|
||||
fn disable_statement_logging(&mut self) -> &mut Self {
|
||||
self.log_statements(LevelFilter::Off)
|
||||
.log_slow_statements(LevelFilter::Off, Duration::default())
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user