From b8a4babd603d09f518581c589fc8607993a5e192 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Mon, 20 Dec 2021 17:42:52 +0100 Subject: [PATCH] Simplify `set_logging()` indexing (#6042) --- utils/general.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/general.py b/utils/general.py index e63ac3e..ef27eb5 100755 --- a/utils/general.py +++ b/utils/general.py @@ -46,7 +46,7 @@ os.environ['NUMEXPR_MAX_THREADS'] = str(NUM_THREADS) # NumExpr max threads def set_logging(name=None, verbose=True): # Sets level and returns logger - for h in logging.root.handlers[:]: + for h in logging.root.handlers: logging.root.removeHandler(h) # remove all handlers associated with the root logger object rank = int(os.getenv('RANK', -1)) # rank in world for Multi-GPU trainings logging.basicConfig(format="%(message)s", level=logging.INFO if (verbose and rank in (-1, 0)) else logging.WARNING)