New submission from Arturo Escaip <[email protected]>:
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.
----------
components: Library (Lib)
messages: 369815
nosy: arturoescaip
priority: normal
severity: normal
status: open
title: Second argument of LoggerAdapter.__init__ should default to None
type: enhancement
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue40756>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com