[Python-Dev] A new way to configure logging (original) (raw)
Doug Hellmann doug.hellmann at gmail.com
Thu Oct 8 14:21:15 CEST 2009
- Previous message: [Python-Dev] A new way to configure logging
- Next message: [Python-Dev] please consider changing --enable-unicode default to ucs4
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Oct 7, 2009, at 10:49 AM, Vinay Sajip wrote:
All three of the contenders for the title of "commonly found configuration mechanism" - JSON, YAML and Python code - will be expressible, in Python, as Python dicts. So it seems to make sense to add, to logging.config, a new callable bound to "dictConfig" which will take a single dictionary argument and configure logging from that dictionary.
I've had bad experiences in the past with dictionary-based APIs. They
seem "simpler" in the short run, because the user "only needs to
create some dictionaries". Once the complexity of that nested
dictionary grows to a certain point, though, one has to refer back to
documentation constantly to make sure the structure conforms to the
"schema". Building a simple config tree using light-weight classes
with documented APIs tends to be more sustainable in the long run.
Doug
- Previous message: [Python-Dev] A new way to configure logging
- Next message: [Python-Dev] please consider changing --enable-unicode default to ucs4
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]