This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author guettli
Recipients guettli, vinay.sajip
Date 2014-05-14.04:57:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1400043434.97.0.670464173446.issue21495@psf.upfronthosting.co.za>
In-reply-to
Content
Thank you for reading and replying. 

Yes, I wrote no concret proposal up to now.

I have this solutions in mind:

logging.config.defaultConfig()

Related https://docs.python.org/2/library/logging.config.html


Loading a python module:
------------------------

load a module "loggingconfig" this module gets imported like any other python module. It is like django loads its settings. It could be possible to check the environment variable LOGGINGCONFIG first. It could contain a string which defaults to "loggingconfig".

This module has a method "set_up()" which sets up the logging for this environment.


Loading from a file:
---------------------

A file searched in this places:

- CWD/.loggingconfig.conf
- VIRTUAL_ENV/.loggingconfig.conf
- HOME/.loggingconfig.conf
- etc/loggingconfig.conf

The file gets loaded with fileConfig()


Module or file config loading
-----------------------------

I think the module loading is better than the file based solution. That's why I think it should be done first. If there is no module found, the file loading should be tried.

If not config found
--------------------

If not config was found, default gets set.

My proposal:
 - loglevel is set to INFO. (Debug gets suppressed)
 - format: '%(asctime)s %(name)s: %(levelname)-8s [%(process)d] %(message)s'
 - logging goes to stdout

---------------------------

What is the best way to get this into the python standard library? Should I create a PEP?
History
Date User Action Args
2014-05-14 04:57:15guettlisetrecipients: + guettli, vinay.sajip
2014-05-14 04:57:14guettlisetmessageid: <1400043434.97.0.670464173446.issue21495@psf.upfronthosting.co.za>
2014-05-14 04:57:14guettlilinkissue21495 messages
2014-05-14 04:57:13guettlicreate