I was about to click “Create pull request” in github with some changes I thought would be well received, but then saw the “Maintainer driven issues” request in the contributing guidelines, so here I am.
My use case is that I wish to run my app using the
uvicorn command line option but also specify a custom logging config. This means
--log-config must currently point to a file using the limited and apparently deprecated
configparser format as
uvicorn uses the
It appeared to be pretty trivial to add support for loading a JSON or YAML config so that one could hand it off to
dictConfig(), so I went ahead and did that work on my fork here. You can see from the commit message that it addresses a couple of other currently open issues.
The changes should be backwards-compatible with existing installations, as it only attempts to load the json or yaml files if the indicated file has the appropriate filename extension. If not, it falls back to the current behavior where the
configparser format is assumed. However, it will now emit a warning letting the client know that they can/should update to the new format so we can hopefully remove the
fileConfig() functionality in the future.