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.

Author gkoller
Recipients gkoller
Date 2012-02-16.15:20:48
SpamBayes Score 4.1853556e-09
Marked as misclassified No
Message-id <1329405649.45.0.0231002086589.issue14031@psf.upfronthosting.co.za>
In-reply-to
Content
When logging messages with variable data one typically writes:

    username = 'Guido'
    logging.info('User %s logged in', username)

However Python 3 has support str.format (PEP 3101). If one has adopted str.format for formatting strings in Python 3 code one should also be able to write the above as:

    logging.info('User {} logged in', username)

However this currently is not supported. For backwards compatibility,% style logging should remain the default. However when a logger is configured using:

    import logging
    logging.basicConfig(style='{', format='{levelname}:{message}')

all subsequent calls to logging.debug, logging.info, logging.warning, logging.error, logging.critical, logging.exception and logging.log should use str.format for formatting.
History
Date User Action Args
2012-02-16 15:20:49gkollersetrecipients: + gkoller
2012-02-16 15:20:49gkollersetmessageid: <1329405649.45.0.0231002086589.issue14031@psf.upfronthosting.co.za>
2012-02-16 15:20:48gkollerlinkissue14031 messages
2012-02-16 15:20:48gkollercreate