Skip to content

Conversation

ShaneHarvey
Copy link
Member

@ShaneHarvey ShaneHarvey commented Sep 5, 2024

PYTHON-4607 Use LogRecord.getMessage() not LogRecord.message

LogRecord.message is documented like this:

The logged message, computed as msg % args. This is set when Formatter.format() is invoked.

It's not set until Formatter.format() or getMessage() is called which explains the AttributeError: 'LogRecord' object has no attribute 'message' errors we've been seeing.

Copy link
Contributor

@NoahStapp NoahStapp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find, thanks!

@ShaneHarvey ShaneHarvey merged commit 29bbf77 into mongodb:master Sep 5, 2024
31 of 33 checks passed
@ShaneHarvey ShaneHarvey deleted the PYTHON-4607 branch September 5, 2024 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants