This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Error inside logging module documentation
Type: Stage:
Components: None Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, giampaolo.rodola
Priority: normal Keywords:

Created on 2007-05-05 18:01 by giampaolo.rodola, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg31959 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2007-05-05 18:01
http://docs.python.org/lib/module-logging.html

Inside the explanation of logging.debug an example code is showed:

 FORMAT = "%(asctime)-15s %(clientip)s %(user)-8s %(message)s"
 logging.basicConfig(format=FORMAT)
 dict = { 'clientip' : '192.168.0.1', 'user' : 'fbloggs' }
 logging.warning("Protocol problem: %s", "connection reset", extra=d)


In the code "dict" is created but never used. 
When logging.warning is called the author use the argument 'd' instead of 'dict' and no reference to 'd' exists:

 logging.warning("Protocol problem: %s", "connection reset", extra=d)
msg31960 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-05-05 18:57
Thanks for the report, fixed in rev. 55154, 55155.
History
Date User Action Args
2022-04-11 14:56:24adminsetgithub: 44932
2007-05-05 18:01:58giampaolo.rodolacreate