PEP 282: Improve upon colloquial phrasing (#2667)
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM> Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
This commit is contained in:
parent
2563e2a419
commit
b9a70c2c14
32
pep-0282.txt
32
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,
|
||||
|
|
Loading…
Reference in New Issue