Skip to content

Commit

Permalink
PEP 282: Improve upon colloquial phrasing (#2667)
Browse files Browse the repository at this point in the history
Co-authored-by: CAM Gerlach <[email protected]>
Co-authored-by: Vinay Sajip <[email protected]>
  • Loading branch information
3 people authored Aug 3, 2022
1 parent 2563e2a commit b9a70c2
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions pep-0282.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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...
Expand All @@ -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...

Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit b9a70c2

Please sign in to comment.