修改了logging的bug

This commit is contained in:
FEIJINTI 2022-08-29 14:34:28 +08:00
parent 210c7354cf
commit 6f2a9a1643

View File

@ -78,7 +78,7 @@ def set_logging(name=None, verbose=VERBOSE):
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 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 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) # logging.basicConfig(format="%(message)s", level=logging.INFO if (verbose and rank in (-1, 0)) else logging.WARNING)
return logging.getLogger(name) return logging.getLogger(name)