[issue45465] logging messages are needlessly reformatted for every handler

2021-10-15 Thread Vinay Sajip
Vinay Sajip added the comment: Oh, I see what you mean now - I was thinking of the overall message formatted using a formatter. However, filters can still change a record's attributes and getMessage() could behave differently on different calls because of this. Changing things in this area c

[issue45465] logging messages are needlessly reformatted for every handler

2021-10-15 Thread Роман Донченко
Роман Донченко added the comment: But message formatting is controlled by the record, not by the handler. The same record will always be formatted the same way (assuming that getMessage is deterministic, which seems like a fair assumption). -- ___

[issue45465] logging messages are needlessly reformatted for every handler

2021-10-15 Thread Vinay Sajip
Vinay Sajip added the comment: A developer may wish to format messages differently for different audiences (i.e. different handlers) - for example, omit stack traces. This behaviour is by design. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___

[issue45465] logging messages are needlessly reformatted for every handler

2021-10-14 Thread Ned Deily
Change by Ned Deily : -- nosy: +vinay.sajip ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue45465] logging messages are needlessly reformatted for every handler

2021-10-13 Thread Роман Донченко
New submission from Роман Донченко : Consider this code: ``` import logging class MyLogRecord(logging.LogRecord): def getMessage(self): print("Help! I am being formatted!") return super().getMessage() logging.setLogRecordFactory(MyLogRecord) logger = logging.getLogger("tes