set loglevels sooner

This commit is contained in:
Jakob Ketterl 2022-11-30 18:53:09 +01:00
parent bba900d8f8
commit 322b6a0d52
1 changed files with 6 additions and 2 deletions

View File

@ -52,6 +52,9 @@ def main():
args = parser.parse_args()
if args.debug:
logging.getLogger().setLevel(logging.DEBUG)
if args.version:
print("OpenWebRX version {version}".format(version=openwebrx_version))
return 0
@ -84,13 +87,14 @@ Support and info: https://groups.io/g/openwebrx
for sig in [signal.SIGINT, signal.SIGTERM]:
signal.signal(sig, handleSignal)
# config warmup
Config.validateConfig()
coreConfig = CoreConfig()
# passed loglevel takes priority (used for the --debug argument)
logging.getLogger().setLevel(coreConfig.get_log_level() if loglevel is None else loglevel)
# config warmup
Config.validateConfig()
featureDetector = FeatureDetector()
failed = featureDetector.get_failed_requirements("core")
if failed: