From 7edad3c2e569e24a51aa51eb084f2dd2cfc6222b Mon Sep 17 00:00:00 2001 From: Gensollen Date: Wed, 4 Sep 2024 12:01:28 +0200 Subject: [PATCH] [FIX] Handle string and integer logging levels in `cprint` (#1278) --- clinica/utils/stream.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/clinica/utils/stream.py b/clinica/utils/stream.py index ceb2b41ed..f5ec12d71 100644 --- a/clinica/utils/stream.py +++ b/clinica/utils/stream.py @@ -56,10 +56,9 @@ def cprint(msg: str, lvl: Optional[Union[str, int, LoggingLevel]] = None) -> Non from logging import getLogger lvl = lvl or LoggingLevel.INFO - # Use the package level logger. + lvl = get_logging_level(lvl) logger = getLogger("clinica") - # Log message as info level. if lvl == LoggingLevel.DEBUG: logger.debug(msg=msg) elif lvl == LoggingLevel.INFO: