Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 76ca3b4

Browse files
committed
logging: Updated library configuration documentation.
1 parent 3b69db2 commit 76ca3b4

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

Doc/library/logging.rst

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,10 +526,18 @@ should have the desired effect. If an organisation produces a number of
526526
libraries, then the logger name specified can be "orgname.foo" rather than
527527
just "foo".
528528

529+
**PLEASE NOTE:** It is strongly advised that you *do not add any handlers other
530+
than* :class:`NullHandler` *to your library's loggers*. This is because the
531+
configuration of handlers is the prerogative of the application developer who
532+
uses your library. The application developer knows their target audience and
533+
what handlers are most appropriate for their application: if you add handlers
534+
"under the hood", you might well interfere with their ability to carry out
535+
unit tests and deliver logs which suit their requirements.
536+
529537
.. versionadded:: 3.1
530538

531-
The :class:`NullHandler` class was not present in previous versions, but is
532-
now included, so that it need not be defined in library code.
539+
The :class:`NullHandler` class was not present in previous versions, but is
540+
now included, so that it need not be defined in library code.
533541

534542

535543

@@ -2141,6 +2149,16 @@ for use by library developers.
21412149

21422150
This method does nothing.
21432151

2152+
.. method:: handle(record)
2153+
2154+
This method does nothing.
2155+
2156+
.. method:: createLock()
2157+
2158+
This method returns `None` for the lock, since there is no
2159+
underlying I/O to which access needs to be serialized.
2160+
2161+
21442162
See :ref:`library-config` for more information on how to use
21452163
:class:`NullHandler`.
21462164

0 commit comments

Comments
 (0)