Skip to content

Commit 4e35cc3

Browse files
committed
PYTHON-5168 Add comments
1 parent ad7801b commit 4e35cc3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pymongo/logger.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,10 @@ class _SDAMStatusMessage(str, enum.Enum):
9797

9898

9999
def _log_client_error() -> None:
100+
# This is called from a daemon thread so check for None to account for interpreter shutdown.
100101
logger = _CLIENT_LOGGER
101102
if logger:
103+
# logger.exception includes the full traceback.
102104
logger.exception("MongoClient background task encountered an error:")
103105

104106

0 commit comments

Comments
 (0)