From b9a70c2c14bfbd436db30f78e3ab7a15aca0c04a Mon Sep 17 00:00:00 2001 From: Kebap Date: Thu, 4 Aug 2022 00:35:23 +0200 Subject: [PATCH] PEP 282: Improve upon colloquial phrasing (#2667) Co-authored-by: CAM Gerlach Co-authored-by: Vinay Sajip --- pep-0282.txt | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/pep-0282.txt b/pep-0282.txt index d9745e40c..bc02ec80f 100644 --- a/pep-0282.txt +++ b/pep-0282.txt @@ -64,7 +64,7 @@ Simple Example This shows a very simple example of how the logging package can be used to generate simple logging output on stderr. -:: +.. code-block:: python --------- mymodule.py ------------------------------- import logging @@ -76,6 +76,8 @@ used to generate simple logging output on stderr. raise TypeError, "Bogus type error for testing" ----------------------------------------------------- +.. code-block:: python + --------- myapp.py ---------------------------------- import mymodule, logging @@ -91,7 +93,9 @@ used to generate simple logging output on stderr. log.info("Ending my app") ----------------------------------------------------- - % python myapp.py +.. code-block:: console + + $ python myapp.py INFO:MyApp: Starting my app DEBUG:MyModule: Doin' stuff... @@ -107,7 +111,9 @@ used to generate simple logging output on stderr. The above example shows the default output format. All aspects of the output format should be configurable, so that -you could have output formatted like this:: +you could have output formatted like this: + +.. code-block:: text 2002-04-19 07:56:58,174 MyModule DEBUG - Doin' stuff... @@ -127,11 +133,9 @@ Logger names fit into a "dotted name" namespace, with dots (periods) indicating sub-namespaces. The namespace of logger objects therefore corresponds to a single tree data structure. -:: - - "" is the root of the namespace - "Zope" would be a child node of the root - "Zope.ZODB" would be a child node of "Zope" +* ``""`` is the root of the namespace +* ``"Zope"`` would be a child node of the root +* ``"Zope.ZODB"`` would be a child node of ``"Zope"`` These Logger objects create **LogRecord** objects which are passed to **Handler** objects for output. Both Loggers and Handlers may @@ -170,13 +174,13 @@ This is done through a module-level function:: Levels ====== -The logging levels, in increasing order of importance, are:: +The logging levels, in increasing order of importance, are: - DEBUG - INFO - WARN - ERROR - CRITICAL +* DEBUG +* INFO +* WARN +* ERROR +* CRITICAL The term CRITICAL is used in preference to FATAL, which is used by log4j. The levels are conceptually the same - that of a serious,