mirror of
https://github.com/python/cpython.git
synced 2025-11-13 23:46:24 +00:00
Logging documentation updates.
This commit is contained in:
parent
efbcb1b038
commit
1397ce1821
1 changed files with 7 additions and 8 deletions
|
|
@ -13,14 +13,13 @@ This page contains a number of recipes related to logging, which have been found
|
||||||
Using logging in multiple modules
|
Using logging in multiple modules
|
||||||
---------------------------------
|
---------------------------------
|
||||||
|
|
||||||
It was mentioned above that multiple calls to
|
Multiple calls to ``logging.getLogger('someLogger')`` return a reference to the
|
||||||
``logging.getLogger('someLogger')`` return a reference to the same logger
|
same logger object. This is true not only within the same module, but also
|
||||||
object. This is true not only within the same module, but also across modules
|
across modules as long as it is in the same Python interpreter process. It is
|
||||||
as long as it is in the same Python interpreter process. It is true for
|
true for references to the same object; additionally, application code can
|
||||||
references to the same object; additionally, application code can define and
|
define and configure a parent logger in one module and create (but not
|
||||||
configure a parent logger in one module and create (but not configure) a child
|
configure) a child logger in a separate module, and all logger calls to the
|
||||||
logger in a separate module, and all logger calls to the child will pass up to
|
child will pass up to the parent. Here is a main module::
|
||||||
the parent. Here is a main module::
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import auxiliary_module
|
import auxiliary_module
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue