[issue6958] Add Python command line flags to configure logging

2016-03-05 Thread Marc Abramowitz
Marc Abramowitz added the comment: I guess I should be more specific about the 12factor thing I just mentioned, because http://12factor.net/logs says: >>> A twelve-factor app never concerns itself with routing or storage of its output stream. It should not attempt to write to or manage logfile

[issue6958] Add Python command line flags to configure logging

2016-03-05 Thread Marc Abramowitz
Marc Abramowitz added the comment: I was just thinking that it would be nice if logging could be configured through environment variables. This would make it easier to have Python applications adhere to the Twelve-Factor methodology around application configuration: http://12factor.net/config

[issue6958] Add Python command line flags to configure logging

2011-02-04 Thread Éric Araujo
Éric Araujo added the comment: I think Antoine’s envvar idea was a good one, similar to PYTHONWARNINGS. -- nosy: +eric.araujo ___ Python tracker ___ _

[issue6958] Add Python command line flags to configure logging

2009-10-01 Thread Vinay Sajip
Vinay Sajip added the comment: Ok. I think it's a reasonable request, but I can see that implementing it naively without some further thought will lead to (justifiable) complaints from some users that the behaviour is contradictory or unintuitive in terms of which configuration "wins" in the eve

[issue6958] Add Python command line flags to configure logging

2009-10-01 Thread Thomas Heller
Thomas Heller added the comment: I retract this request. It seems the idea is not liked or a solution is not easy. (The solution I now use is to start Python from a batch file that parses some command line flags itself, sets environment variables, and my sitecustomize.py file configures loggin

[issue6958] Add Python command line flags to configure logging

2009-09-22 Thread Vinay Sajip
Vinay Sajip added the comment: Ummm, s/logging -m/-m logging/ -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue6958] Add Python command line flags to configure logging

2009-09-22 Thread Vinay Sajip
Vinay Sajip added the comment: @theller: Although your use case just covers using basicConfig, I can just see users expecting the same mechanism to invoke configuration stored in a logging configuration file, which is why I suggested the config= variant. However, doughellmann raises the valid po

[issue6958] Add Python command line flags to configure logging

2009-09-22 Thread Doug Hellmann
Doug Hellmann added the comment: @theller, I'm not sure what your point is. I'm asking what the defined behavior is if we provide some sort of global way to run a program with logging configured, and then that app turns around and tries to reconfigure it. Should the last one to call the config

[issue6958] Add Python command line flags to configure logging

2009-09-22 Thread Thomas Heller
Thomas Heller added the comment: > How do these "global" settings (either via the interpreter or a wrapper > in the logging module) change what an app might do on its own? IOW, if > my app is already written to configure logging, and someone invokes it > with these other settings, which setting

[issue6958] Add Python command line flags to configure logging

2009-09-22 Thread Thomas Heller
Thomas Heller added the comment: > Jean-Paul Calderone: > > How about putting this into the logging module instead? Instead of > "python ", making it > "python -m logging > This: > > * involves no changes to the core interpreter > * only requires Python to be written, not C > * Le

[issue6958] Add Python command line flags to configure logging

2009-09-22 Thread Vinay Sajip
Vinay Sajip added the comment: Both Doug and Jean-Paul have made good points, IMO. -- ___ Python tracker ___ ___ Python-bugs-list mail

[issue6958] Add Python command line flags to configure logging

2009-09-21 Thread Doug Hellmann
Doug Hellmann added the comment: How do these "global" settings (either via the interpreter or a wrapper in the logging module) change what an app might do on its own? IOW, if my app is already written to configure logging, and someone invokes it with these other settings, which settings are us

[issue6958] Add Python command line flags to configure logging

2009-09-21 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: How about putting this into the logging module instead? Instead of "python ", making it "python -m logging ___ ___ Python-bugs-list mail

[issue6958] Add Python command line flags to configure logging

2009-09-21 Thread R. David Murray
R. David Murray added the comment: I don't think this is about logging in stdlib modules that are run directly. I think this is about a library that contains logging calls (eg: multiprocessing), and is used in j-random-application, and while prototyping/debugging the application you want to acce

[issue6958] Add Python command line flags to configure logging

2009-09-21 Thread Doug Hellmann
Doug Hellmann added the comment: I think I'm with Michael on this one. I'd rather add logging configuration to any stdlib modules that support being run directly and want to support logging. -- ___ Python tracker

[issue6958] Add Python command line flags to configure logging

2009-09-21 Thread Vinay Sajip
Vinay Sajip added the comment: If we do include interpreter support, there should be an option to invoke a configuration file, too: -l config=path Mutually exclusive with all the other options. So, you can either use it to invoke basicConfig or to invoke an arbitrary configuration in a file.

[issue6958] Add Python command line flags to configure logging

2009-09-21 Thread Thomas Heller
Thomas Heller added the comment: > Why does this need to be built into the interpreter? The script / app > should have logging config support. It does not need to, but it would be nice. I think the '-l' flag should be similar to the -W flag. Or consider for example using unittest.main() as scri

[issue6958] Add Python command line flags to configure logging

2009-09-21 Thread Michael Foord
Michael Foord added the comment: Why does this need to be built into the interpreter? The script / app should have logging config support. -- nosy: +michael.foord ___ Python tracker

[issue6958] Add Python command line flags to configure logging

2009-09-21 Thread Georg Brandl
Georg Brandl added the comment: Also, don't forget to update the "python -h" help text. -- nosy: +georg.brandl ___ Python tracker ___

[issue6958] Add Python command line flags to configure logging

2009-09-21 Thread R. David Murray
R. David Murray added the comment: Also possibly relevant was the recent python-dev discussion about replicating (some of) the command line argument parsing in python so that it can be used by things other than the 'python' command: http://mail.python.org/pipermail/python-dev/2009-August/091484

[issue6958] Add Python command line flags to configure logging

2009-09-21 Thread Eric Smith
Eric Smith added the comment: The C code looks basically okay to me. I'd probably use strdup() instead of the malloc/strlen/strcpy calls. And as Thomas said, the cleanup needs a little bit of work. -- ___ Python tracker

[issue6958] Add Python command line flags to configure logging

2009-09-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: If you want to add flags to the main executable, it deserves a discussion on python-dev IMO. It could be obtained through an environment variable, e.g. PYLOGGING_CONFIG; which has the nice side-effect of working for executable scripts too. -- nosy: +pit

[issue6958] Add Python command line flags to configure logging

2009-09-21 Thread Thomas Heller
Thomas Heller added the comment: > I get the idea. The Python part of the patch demonstrates what you're > getting at, though it can't be used as is - for example the > getattr(logging, a, a) could lead to problems. However a more > intelligent parser (which looked for specific keywords recognis

[issue6958] Add Python command line flags to configure logging

2009-09-21 Thread Vinay Sajip
Vinay Sajip added the comment: I get the idea. The Python part of the patch demonstrates what you're getting at, though it can't be used as is - for example the getattr(logging, a, a) could lead to problems. However a more intelligent parser (which looked for specific keywords recognised by basi

[issue6958] Add Python command line flags to configure logging

2009-09-21 Thread Doug Hellmann
Changes by Doug Hellmann : -- nosy: +doughellmann ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue6958] Add Python command line flags to configure logging

2009-09-21 Thread R. David Murray
Changes by R. David Murray : -- nosy: +vsajip priority: -> normal versions: +Python 2.7, Python 3.2 ___ Python tracker ___ ___ Python-

[issue6958] Add Python command line flags to configure logging

2009-09-21 Thread Eric Smith
Changes by Eric Smith : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue6958] Add Python command line flags to configure logging

2009-09-21 Thread Thomas Heller
New submission from Thomas Heller : I want the Python executable to have command line flags which allow simple configuration of the logging module. Use cases are to run applications/scripts (which use libraries that use logging calls) with different logging output without having to edit (ugly) l