Handle 'MILCInterface' object has no attribute 'log_level' error (#24549)

This commit is contained in:
Joel Challis 2024-10-30 11:26:53 +00:00 committed by GitHub
parent 6693a30671
commit 465cbc87de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -119,8 +119,11 @@ def filter_help() -> str:
def _set_log_level(level): def _set_log_level(level):
cli.acquire_lock() cli.acquire_lock()
try:
old = cli.log_level old = cli.log_level
cli.log_level = level cli.log_level = level
except AttributeError:
old = cli.log.level
cli.log.setLevel(level) cli.log.setLevel(level)
logging.root.setLevel(level) logging.root.setLevel(level)
cli.release_lock() cli.release_lock()