> Let's plan a cmdline argument then. > Should we go for -L<level> much like -W<warning>?
Yeah, I think a command-line argument is much more reasonable, less likely to cause issues with other implementations of logging configuration, and more practically useful. I'd be +1 on something like a `-L<level>`. On Thu, Feb 20, 2020 at 2:05 PM Bar Harel <bzvi7...@gmail.com> wrote: > Let's plan a cmdline argument then. > > Should we go for -L<level> much like -W<warning>? > Or -x logging for setting a default value of debug or info? > > Per python specification, -x is implementation dependent. > > I'll advocate for -L. I think the same concerns as -W are relevant for all > python implementations, and it gives more flexibility in terms of log level. > > Next question: Should -x dev include it? > If it was python day-1, I would say yes. My issue is the double inclusion > of stream handlers in case the logging was bootstrapped already. > So -x dev probably shouldn't include it. > > On Thu, Feb 20, 2020, 8:28 PM Christopher Barker <python...@gmail.com> > wrote: > >> I think it’s a “Bad Idea” to use an environment variable — who knows what >> Python script may be running on a given system? >> >> But a standard command line argument to the interpreter could be useful. >> >> -CHB >> >> On Thu, Feb 20, 2020 at 8:51 AM Mike Miller <python-id...@mgmiller.net> >> wrote: >> >>> >>> On 2020-02-19 17:12, Bar Harel wrote: >>> > Another idea I've had that may be of use: >>> > >>> > PYTHONLOGGING environment variable. >>> > >>> > Setting PYTHONLOGGING to any log level or level name will initialize >>> > logging.basicConfig() with that appropriate level. >>> > >>> > Another option would be that -x dev or a different -x logging will >>> initialize >>> > basic config. >>> >>> As a heavy user of logging, I like this one a lot. In a new project, >>> the lack >>> of such a feature allows one to stick with print() perhaps longer than >>> is prudent. >>> >>> -Mike >>> _______________________________________________ >>> Python-ideas mailing list -- python-ideas@python.org >>> To unsubscribe send an email to python-ideas-le...@python.org >>> https://mail.python.org/mailman3/lists/python-ideas.python.org/ >>> Message archived at >>> https://mail.python.org/archives/list/python-ideas@python.org/message/US4RHU5S7MAEUJG7MPQIFZWM324IXNB6/ >>> Code of Conduct: http://python.org/psf/codeofconduct/ >>> >> -- >> Christopher Barker, PhD >> >> Python Language Consulting >> - Teaching >> - Scientific Software Development >> - Desktop GUI and Web Development >> - wxPython, numpy, scipy, Cython >> _______________________________________________ >> Python-ideas mailing list -- python-ideas@python.org >> To unsubscribe send an email to python-ideas-le...@python.org >> https://mail.python.org/mailman3/lists/python-ideas.python.org/ >> Message archived at >> https://mail.python.org/archives/list/python-ideas@python.org/message/YTYC4XPF5SWGWYI4DIGCXIEA53HMTNQU/ >> Code of Conduct: http://python.org/psf/codeofconduct/ >> > _______________________________________________ > Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/KGRSK4U2L4MNMY57IG3XD52WHLOWG6OG/ > Code of Conduct: http://python.org/psf/codeofconduct/ >
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/XBLAIDGK36WBXBMZQGXIJ2WCS3VQ2DSE/ Code of Conduct: http://python.org/psf/codeofconduct/