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: Add PYTHONLOGGING environment variable and -L cmdline argument
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.10
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: bar.harel, vinay.sajip
Priority: normal Keywords:

Created on 2020-06-06 01:11 by bar.harel, last changed 2022-04-11 14:59 by admin.

Messages (1)
msg370807 - (view) Author: Bar Harel (bar.harel) * Date: 2020-06-06 01:11
Per discussion on mailing list, I suggest adding a PYTHONLOGGING environment variable, and a matching -L cmdline argument.

When set to a logging level of choice, they will initiate basicConfig with the appropriate level.

For example, "py.exe -L info" will be equivalent to "logging.basicConfig(level='info')" on interpreter startup.

Sames as setting env var "PYTHONLOGGING=info".

This matches the current behavior of other settings, such as PYTHONWARNINGS and -W, allows to easily test programs without modifying them, and further completes the expected arguments available from the commandline.

Discussion on mailing list for reference:
https://mail.python.org/archives/list/python-ideas@python.org/thread/I74LVJWJLE2LUCCZGOF5A5JDSDHJ6WX2/
History
Date User Action Args
2022-04-11 14:59:32adminsetgithub: 85063
2020-06-06 01:24:26xtreaksetnosy: + vinay.sajip
2020-06-06 01:11:59bar.harelcreate