Message218499
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? |
|
Date |
User |
Action |
Args |
2014-05-14 04:57:15 | guettli | set | recipients:
+ guettli, vinay.sajip |
2014-05-14 04:57:14 | guettli | set | messageid: <1400043434.97.0.670464173446.issue21495@psf.upfronthosting.co.za> |
2014-05-14 04:57:14 | guettli | link | issue21495 messages |
2014-05-14 04:57:13 | guettli | create | |
|