From 6c63165436dd3210058c8a53f4cfff54857b7465 Mon Sep 17 00:00:00 2001 From: Kebap Date: Fri, 24 Jun 2022 15:00:51 +0200 Subject: [PATCH 1/4] Colloquial phrasing messed with highlighting Also it is better readable for non-English native speakers. --- pep-0282.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pep-0282.txt b/pep-0282.txt index 9b143f90853..bd7eebb55a0 100644 --- a/pep-0282.txt +++ b/pep-0282.txt @@ -71,7 +71,7 @@ used to generate simple logging output on stderr. log = logging.getLogger("MyModule") def doIt(): - log.debug("Doin' stuff...") + log.debug("Doing stuff...") #do stuff... raise TypeError, "Bogus type error for testing" ----------------------------------------------------- @@ -94,7 +94,7 @@ used to generate simple logging output on stderr. % python myapp.py INFO:MyApp: Starting my app - DEBUG:MyModule: Doin' stuff... + DEBUG:MyModule: Doing stuff... ERROR:MyApp: There was a problem. Traceback (most recent call last): File "myapp.py", line 9, in ? @@ -109,11 +109,11 @@ 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:: - 2002-04-19 07:56:58,174 MyModule DEBUG - Doin' stuff... + 2002-04-19 07:56:58,174 MyModule DEBUG - Doing stuff... or just - Doin' stuff... + Doing stuff... Control Flow From abe374e75f4f5febb9fdaf03a8bf32d79e39f598 Mon Sep 17 00:00:00 2001 From: Kebap Date: Tue, 2 Aug 2022 09:33:03 +0200 Subject: [PATCH 2/4] undo last commit --- pep-0282.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pep-0282.txt b/pep-0282.txt index bd7eebb55a0..9b143f90853 100644 --- a/pep-0282.txt +++ b/pep-0282.txt @@ -71,7 +71,7 @@ used to generate simple logging output on stderr. log = logging.getLogger("MyModule") def doIt(): - log.debug("Doing stuff...") + log.debug("Doin' stuff...") #do stuff... raise TypeError, "Bogus type error for testing" ----------------------------------------------------- @@ -94,7 +94,7 @@ used to generate simple logging output on stderr. % python myapp.py INFO:MyApp: Starting my app - DEBUG:MyModule: Doing stuff... + DEBUG:MyModule: Doin' stuff... ERROR:MyApp: There was a problem. Traceback (most recent call last): File "myapp.py", line 9, in ? @@ -109,11 +109,11 @@ 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:: - 2002-04-19 07:56:58,174 MyModule DEBUG - Doing stuff... + 2002-04-19 07:56:58,174 MyModule DEBUG - Doin' stuff... or just - Doing stuff... + Doin' stuff... Control Flow From 15a666ffa7f9ce4b3410018351ed7faefce37930 Mon Sep 17 00:00:00 2001 From: Kebap Date: Tue, 2 Aug 2022 09:44:03 +0200 Subject: [PATCH 3/4] include feedback from review --- pep-0282.txt | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/pep-0282.txt b/pep-0282.txt index 9b143f90853..8c7aa43ef36 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, From 0da14066aa6b637c78b1cf34159e6ae9ea575631 Mon Sep 17 00:00:00 2001 From: Vinay Sajip Date: Wed, 3 Aug 2022 11:08:03 +0100 Subject: [PATCH 4/4] Retain literal markup. Co-authored-by: CAM Gerlach --- pep-0282.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pep-0282.txt b/pep-0282.txt index 8c7aa43ef36..1ad2e923bdd 100644 --- a/pep-0282.txt +++ b/pep-0282.txt @@ -133,9 +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