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 AndrewCarterUK
Recipients AndrewCarterUK, docs@python
Date 2019-07-15.17:11:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1563210681.88.0.786597036054.issue37598@roundup.psfhosted.org>
In-reply-to
Content
Current docs link: https://docs.python.org/3/howto/logging-cookbook.html#implementing-structured-logging

GitHub commit link: https://github.com/python/cpython/commit/4b88d6c6642450240a9dc22e6efbdc69baf890dd

The suggestion is that for structured logging, a StructuredMessage class should be created with a __str__ method defined and then assigned to an _ variable and used as a logging formatter.

As the _ variable is commonly used as a "skip variable" and it has other meanings inside the Python interactive shell - I recommend that this example is changed to one that maybe just defines a simple wrapper function.

I'm happy to create a PR for this - but only if there's agreement that it's worthwhile and will get merged if suitable.

Thanks,

Andrew
History
Date User Action Args
2019-07-15 17:11:21AndrewCarterUKsetrecipients: + AndrewCarterUK, docs@python
2019-07-15 17:11:21AndrewCarterUKsetmessageid: <1563210681.88.0.786597036054.issue37598@roundup.psfhosted.org>
2019-07-15 17:11:21AndrewCarterUKlinkissue37598 messages
2019-07-15 17:11:21AndrewCarterUKcreate