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 <rep...@bugs.python.org>
<http://bugs.python.org/issue30995>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to