glenn-jocher commited on
Commit
b8a4bab
·
unverified ·
1 Parent(s): 0db9d5b

Simplify `set_logging()` indexing (#6042)

Browse files
Files changed (1) hide show
  1. utils/general.py +1 -1
utils/general.py CHANGED
@@ -46,7 +46,7 @@ os.environ['NUMEXPR_MAX_THREADS'] = str(NUM_THREADS) # NumExpr max threads
46
 
47
  def set_logging(name=None, verbose=True):
48
  # Sets level and returns logger
49
- for h in logging.root.handlers[:]:
50
  logging.root.removeHandler(h) # remove all handlers associated with the root logger object
51
  rank = int(os.getenv('RANK', -1)) # rank in world for Multi-GPU trainings
52
  logging.basicConfig(format="%(message)s", level=logging.INFO if (verbose and rank in (-1, 0)) else logging.WARNING)
 
46
 
47
  def set_logging(name=None, verbose=True):
48
  # Sets level and returns logger
49
+ for h in logging.root.handlers:
50
  logging.root.removeHandler(h) # remove all handlers associated with the root logger object
51
  rank = int(os.getenv('RANK', -1)) # rank in world for Multi-GPU trainings
52
  logging.basicConfig(format="%(message)s", level=logging.INFO if (verbose and rank in (-1, 0)) else logging.WARNING)