[Python-ideas] logging.config.defaultConfig()
M.-A. Lemburg
mal at egenix.com
Sat May 17 14:27:32 CEST 2014
On 17.05.2014 10:56, Nick Coghlan wrote:
> On 16 May 2014 21:34, M.-A. Lemburg <mal at egenix.com> wrote:
>> On 16.05.2014 11:54, Antoine Pitrou wrote:
>>>> While I agree that importing a module might not be the right way, having
>>>> a standard way to configure logging via environment variables might be
>>>> helpful.
>>>
>>> I entirely disagree. An environment variable is a very lousy way to
>>> specify a configuration file's location; and there is no reason to have
>>> a common logging configuration for all Python applications.
>>
>> Hmm, it's a fairly standard way to define config file locations esp.
>> on Unix platforms, so I don't follow you here. Perhaps I'm just
>> missing some context.
>>
>> Such env vars are often used in application environments to override
>> system defaults, e.g. for finding OpenSSL or ODBC config files.
>
> Python is a language runtime, not an application. Having globally
> configurable behaviours for a runtime is, in general, questionable,
> which is why we have the options to ignore the environment variables,
> site-packages, user site-packages and now the "isolated mode" flag
> that basically says "ignore *every* explicitly configurable Python
> setting in the environment".
Right, but those options address specific use cases (e.g.
for setting up testing environments). Their existence does
not imply that having config variables for all of the above
is a bad thing, as you seem to imply - otherwise, we wouldn't
have them in the first place ;-)
Logging is just another runtime feature, just like writing
PYC files or setting a search path. Now, configuring logging
is too complex to do on the command line, so pointing the
runtime to a logging config file instead seems like a good idea.
Of course, an application could just as well do this, so the
question really is whether we should have it in general or not.
PS: Note that with "application environment" I'm referring to
exactly that: a shell environment with environment options
specifically setup for a specific application. You typically
use those for application specific user accounts, not globally.
--
Marc-Andre Lemburg
eGenix.com
Professional Python Services directly from the Source (#1, May 17 2014)
>>> Python Projects, Consulting and Support ... http://www.egenix.com/
>>> mxODBC.Zope/Plone.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
________________________________________________________________________
::::: Try our mxODBC.Connect Python Database Interface for free ! ::::::
eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
Registered at Amtsgericht Duesseldorf: HRB 46611
http://www.egenix.com/company/contact/
More information about the Python-ideas
mailing list