You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/writing/logging.rst
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ The :mod:`logging` module has been a part of Python's Standard Library since
10
10
version 2.3. It is succinctly described in :pep:`282`. The documentation
11
11
is notoriously hard to read, except for the `basic logging tutorial`_.
12
12
13
-
As an alternative, `loguru <https://github.com/Delgan/loguru>`_ provides an approach to logging nearly as simple as using a simple ``print`` statement.
13
+
As an alternative, `loguru <https://github.com/Delgan/loguru>`_ provides an approach for logging, nearly as simple as using a simple ``print`` statement.
14
14
15
15
Logging serves two purposes:
16
16
@@ -59,7 +59,7 @@ using the ``__name__`` global variable: the :mod:`logging` module creates a
59
59
hierarchy of loggers using dot notation, so using ``__name__`` ensures
60
60
no name collisions.
61
61
62
-
Here is an example of best practice from the `requests source`_ -- place
62
+
Here is an example of the best practice from the `requests source`_ -- place
63
63
this in your ``__init__.py``:
64
64
65
65
.. code-block:: python
@@ -83,7 +83,7 @@ application environment.
83
83
There are at least three ways to configure a logger:
84
84
85
85
- Using an INI-formatted file:
86
-
- **Pro**: possible to update configuration while running using the
86
+
- **Pro**: possible to update configuration while running, using the
87
87
function :func:`logging.config.listen` to listen on a socket.
88
88
- **Con**: less control (e.g. custom subclassed filters or loggers)
89
89
than possible when configuring a logger in code.
@@ -94,13 +94,13 @@ There are at least three ways to configure a logger:
94
94
- **Con**: less control than when configuring a logger in code.
95
95
- Using code:
96
96
- **Pro**: complete control over the configuration.
97
-
- **Con**: modifications require a change to source code.
97
+
- **Con**: modifications require a change to the source code.
98
98
99
99
100
100
Example Configuration via an INI File
101
101
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
102
102
103
-
Let us say the file is named ``logging_config.ini``.
103
+
Let us say that the file is named ``logging_config.ini``.
104
104
More details for the file format are in the `logging configuration`_
0 commit comments