AdminEmailHandler ignores user args to log message.
|Reported by:||saverio.trioni@…||Owned by:||strioni|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
When using AdminEmailHandler to log own code, the mail subject and content has the raw LogRecord msg attribute instead of the LogRecord.getMessage() merged string.
This appears when using the standard log API
foo, bar = 'hello', 'world' logger.error("The configuration is %s %s", foo, bar)
The email subject should be "The configuration is hello world" (barring configured prefixes), but is "The configuration is %s %s". The same happens to the email content.
This can be solved using record.getMessage() instead of record.msg to get the message.
Change History (13)
comment:1 Changed 4 years ago by strioni
- Has patch set
- Needs documentation unset
- Needs tests set
- Patch needs improvement unset
comment:2 Changed 4 years ago by strioni
- Owner changed from nobody to strioni
- Status changed from new to assigned
comment:3 Changed 4 years ago by julien
- Component changed from Uncategorized to Core (Other)
- Triage Stage changed from Unreviewed to Accepted
Changed 4 years ago by julien
comment:8 Changed 4 years ago by julien
- Resolution set to fixed
- Status changed from assigned to closed