-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-98731: Improvements to the logging documentation #101618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Doc/howto/logging.rst
Outdated
@@ -26,9 +26,11 @@ When to use logging | ||
^^^^^^^^^^^^^^^^^^^ | ||
|
||
Logging provides a set of convenience functions for simple logging usage. These |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since your change refers to using logger methods rather than the convenience functions, I'd remove this sentence and go with something like "You can access logging functionality by creating a logger via ..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Doc/howto/logging.rst
Outdated
:func:`critical`. To determine when to use logging, see the table below, which | ||
states, for each of a set of common tasks, the best tool to use for it. | ||
can be accessed by creating a logger via ``logger = getLogger(__name__)``, and | ||
then calling :func:`logger.debug`, :func:`logger.info`, :func:`logger.warning`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use : meth:
here rather than :func:
maybe? This applies to similar usages below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
then calling :func:`logger.debug`, :func:`logger.info`, :func:`logger.warning`, | ||
:func:`logger.error` and :func:`logger.critical`. To determine when to use | ||
logging, see the table below, which states, for each of a set of common tasks, | ||
the best tool to use for it. | ||
|
||
+-------------------------------------+--------------------------------------+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you actually build this documentation locally? If you did, not sure how it got past these errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not. I will try to build them locally and message if I have issues.
Doc/howto/logging.rst
Outdated
module, like ``logging.debug``, rather than creating a logger and calling | ||
functions on it. These functions operation on the root logger, but can be useful | ||
as they will call ``basicConfig`` for you if it has not been called yet, like in | ||
this example. In larger programs you'll usually want to control this call |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this example. In larger programs you'll usually want to control this call | |
this example. In larger programs you'll usually want to control the logging configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Doc/howto/logging.rst
Outdated
| server process) | appropriate for the specific error | | ||
| | and application domain | | ||
+-------------------------------------+--------------------------------------+ | ||
|
||
The logging functions are named after the level or severity of the events | ||
The functions are named after the level or severity of the events |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The functions are named after the level or severity of the events | |
The logger methods are named after the level or severity of the events |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Doc/library/logging.rst
Outdated
Logs a message with level :const:`WARNING` on the root logger. The arguments | ||
are interpreted as for :func:`debug`. | ||
Logs a message with level :const:`WARNING` on the root logger. The arguments and behavior | ||
are the otherwise same as for :func:`debug`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are the otherwise same as for :func:`debug`. | |
are otherwise the same as for :func:`debug`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Doc/library/logging.rst
Outdated
Logs a message with level :const:`ERROR` on the root logger. The arguments are | ||
interpreted as for :func:`debug`. | ||
Logs a message with level :const:`ERROR` on the root logger. The arguments and behavior | ||
are the otherwise same as for :func:`debug`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are the otherwise same as for :func:`debug`. | |
are otherwise the same as for :func:`debug`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Doc/library/logging.rst
Outdated
Logs a message with level :const:`CRITICAL` on the root logger. The arguments | ||
are interpreted as for :func:`debug`. | ||
Logs a message with level :const:`CRITICAL` on the root logger. The arguments and behavior | ||
are the otherwise same as for :func:`debug`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are the otherwise same as for :func:`debug`. | |
are otherwise the same as for :func:`debug`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Doc/library/logging.rst
Outdated
Logs a message with level :const:`ERROR` on the root logger. The arguments are | ||
interpreted as for :func:`debug`. Exception info is added to the logging | ||
Logs a message with level :const:`ERROR` on the root logger. The arguments and behavior | ||
are the otherwise same as for :func:`debug`. Exception info is added to the logging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are the otherwise same as for :func:`debug`. Exception info is added to the logging | |
are otherwise the same as for :func:`debug`. Exception info is added to the logging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Also @quicknir please remember to sign the CLA and resolve the build errors. |
Hi @quicknir, are you planning to work on this in the near future? |
@vsajip Hey, yes, I should have some time to work on this soon. |
Hi @quicknir - any idea when you might have time to progress this? |
@vsajip Hey, sorry for the hold up. I think I will have some time in mid January; going to try to make it a goal to have this merged in Jan-Feb. |
Any chance you'll be able to work on this soon, @quicknir? |
b89cfa1
to
34f3e79
Compare
@vsajip hey, I integrated all your feedback, rebased, built the docs locally (fixing another issue in the process). Hopefully we can power this through :-). |
Thanks. The docs build is failing because of warnings, I'm not yet sure if it's caused by your changes but hope to look more closely soon. |
@vsajip I suspect that they are, they all look like this
But I'm not sure I understand exactly why it's happening. |
GH-116733 is a backport of this pull request to the 3.11 branch. |
GH-116734 is a backport of this pull request to the 3.12 branch. |
@vsajip thanks for your patience, and cheers on merging it :-) |
…01618) Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
…01618) Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
…01618) Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
This PR is probably just a starting point, but hopefully we can begin with this and iterate.