[New-bugs-announce] [issue30995] Support logging.getLogger(style='{')

Mitar report at bugs.python.org
Sat Jul 22 21:29:55 EDT 2017


New submission from Mitar:

Currently, using non-legacy formatting in logging message is really cumbersome. I think a new style could be supported much easier using the following:

logger = logging.getLogger(style='{')
logger.misc('User {} logged in', username}

This is both backwards compatible, and does not interfere with 3rd party packages which might use a different logger with different style. You only have to make sure they do not use this logger without knowing about new format, which can be done in various ways (like prefixing the name of the logger, for example).

See https://bugs.python.org/issue14031 for more information, where this has also been proposed but not really commented upon.

----------
components: Library (Lib)
messages: 298883
nosy: mitar
priority: normal
severity: normal
status: open
title: Support logging.getLogger(style='{')
type: enhancement
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30995>
_______________________________________


More information about the New-bugs-announce mailing list