fixes nio logger configuration for nio >= 0.21

This commit is contained in:
gridtime 2023-08-07 20:17:54 +02:00
parent 45d98fe0b5
commit 8d430953f2
No known key found for this signature in database
GPG Key ID: FB6ACC7A1C9182F8

View File

@ -41,8 +41,11 @@ from .user_files import (
# Logging configuration # Logging configuration
log.getLogger().setLevel(log.INFO) log.getLogger().setLevel(log.INFO)
nio.logger_group.level = nio.log.logbook.WARNING if hasattr(nio, 'log'):
nio.log.logbook.StreamHandler(sys.stderr).push_application() nio.logger_group.level = nio.log.logbook.WARNING
nio.log.logbook.StreamHandler(sys.stderr).push_application()
else:
log.getLogger('nio').setLevel(log.WARNING)
class Backend: class Backend: