bandersnatch
bandersnatch copied to clipboard
Setting log-config option in config errors about formatters
Running with the 1log-config` setting we currently crash. Example config:
[mirror]
...
log-config = /data/pip/bandersnatch-log.conf
...
Causes:
crl-m1:bandersnatch cooper$ /tmp/tb/bin/bandersnatch --debug -c /tmp/bandersnatch.conf mirror 2>&1 | tee /tmp/bandersnatch_run_1
Traceback (most recent call last):
File "/tmp/tb/bin/bandersnatch", line 8, in <module>
sys.exit(main())
File "/private/tmp/tb/lib/python3.9/site-packages/bandersnatch/main.py", line 215, in main
logging.config.fileConfig(str(Path(config.get("mirror", "log-config"))))
File "/opt/homebrew/Cellar/[email protected]/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/logging/config.py", line 71, in fileConfig
formatters = _create_formatters(cp)
File "/opt/homebrew/Cellar/[email protected]/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/logging/config.py", line 104, in _create_formatters
[mirror]
flist = cp["formatters"]["keys"]
File "/opt/homebrew/Cellar/[email protected]/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/configparser.py", line 963, in __getitem__
raise KeyError(key)
KeyError: 'formatters'
I came back to look at this to land - But this didn't ned a fix, this option requires a valid Python logging ini config, so it
I will take a PR making the logging clearer or something here. But putting low priority for me at the moment.