[Python-ideas] logging.config.defaultConfig()

Thomas Guettler guettli at thomas-guettler.de
Fri May 16 13:08:17 CEST 2014


Am 16.05.2014 11:54, schrieb Antoine Pitrou:
> On Fri, 16 May 2014 11:32:55 +0200
> Jonas Wielicki <j.wielicki at sotecware.net>
> wrote:
>> On 16.05.2014 11:27, Antoine Pitrou wrote:
>>> On Fri, 16 May 2014 09:05:11 +0200
>>> Thomas Güttler
>>> <guettli at thomas-guettler.de> wrote:
>>>>
>>>> I think the following solution is very flexible and solves most needs to set up logging,
>>>> since I can implement your needs in for example your_environment_module.set_up()
>>>
>>> This looks dubious to me. There is no reason to have a shared Python
>>> logging configuration, IMO. Also, I don't understand why this is
>>> importing a module.
>>
>> 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.

** I don't want a common logging configuration **

I want a standard hook to find the logging configuration.

And I want it to be a Python method. If you prefer a file config,
create a method which loads your config file. This would make
the spec "simple and stupid".

The configuration should be empty by default. Only if the environment
wants to have a common config, it should provide one.



Thomas


-- 
Thomas Guettler http://www.thomas-guettler.de/


More information about the Python-ideas mailing list