From 90cb3bb96a2fceac4d78bf4efa8f80b1f9533d46 Mon Sep 17 00:00:00 2001 From: Sharvil Patankar Date: Tue, 6 Feb 2024 14:23:27 -0500 Subject: [PATCH] Made changes to drop logging if program is being terminated. Credit to dvarrazzo --- lib/extras.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/extras.py b/lib/extras.py index b05b9d9c..fdda9527 100644 --- a/lib/extras.py +++ b/lib/extras.py @@ -409,7 +409,9 @@ class LoggingConnection(_connection): """ Public interface of the log method defined in initialize """ - return self._log()(*args, **kwargs) + log = self._log() + if log: + return self._log()(*args, **kwargs) def filter(self, msg, curs): """Filter the query before logging it.