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

Jonas Wielicki j.wielicki at sotecware.net
Fri May 16 11:32:55 CEST 2014


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.

Configuring logging is a difficult thing if done fully, like, allowing
different loglevels for different loggers. Having this implemented in
the standard library might be actually useful (and it’s also done that
way in other languages).

regards,
Jonas

> 
> If all your scripts are part of an application, then it's reasonable
> for them to share a mechanism for logging configuration. But it should
> be done in your application, not in Python itself.
> 
> Regards
> 
> Antoine.
> 
> 
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
> 



More information about the Python-ideas mailing list