This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Second argument of LoggerAdapter.__init__ should default to None
Type: enhancement Stage: resolved
Components: Library (Lib) Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: vinay.sajip Nosy List: arturoescaip, iritkatriel, miss-islington, vinay.sajip
Priority: normal Keywords: patch

Created on 2020-05-24 18:02 by arturoescaip, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 20362 merged arturoescaip, 2020-05-24 18:10
Messages (4)
msg369815 - (view) Author: Arturo Escaip (arturoescaip) * Date: 2020-05-24 18:02
The 'extra' argument is not always used by custom logger adapters. There
example:

class IndentAdapter(logging.LoggerAdapter):
    def process(self, msg, kwargs):
        indent = kwargs.pop(indent, 1)
        return ' ' * indent + msg, kwargs

It is cleaner and friendlier to default the 'extra' argument to None
instead of either forcing the subclasses of LoggerAdapter to pass a None
value directly or to override the constructor.
msg369991 - (view) Author: miss-islington (miss-islington) Date: 2020-05-26 14:55
New changeset 8ad052464a4e0aef9a11663b80f187087b773592 by Arturo Escaip in branch 'master':
bpo-40756: Default second argument of LoggerAdapter.__init__ to None (GH-20362)
https://github.com/python/cpython/commit/8ad052464a4e0aef9a11663b80f187087b773592
msg375564 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2020-08-17 18:58
looks like this can be closed now?
msg375575 - (view) Author: Arturo Escaip (arturoescaip) * Date: 2020-08-17 22:50
Done.
History
Date User Action Args
2022-04-11 14:59:31adminsetgithub: 84933
2020-08-17 22:50:37arturoescaipsetmessages: + msg375575
2020-08-17 22:50:12arturoescaipsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-08-17 18:58:01iritkatrielsetnosy: + iritkatriel
messages: + msg375564
2020-05-26 14:55:25miss-islingtonsetnosy: + miss-islington
messages: + msg369991
2020-05-25 18:19:20rhettingersetassignee: vinay.sajip

nosy: + vinay.sajip
2020-05-24 18:10:57arturoescaipsetkeywords: + patch
stage: patch review
pull_requests: + pull_request19626
2020-05-24 18:02:38arturoescaipcreate