Skip to content

Commit

Permalink
Simplify set_logging() indexing (ultralytics#6042)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher authored Dec 20, 2021
1 parent 3ba419e commit f552346
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

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)
Expand Down

0 comments on commit f552346

Please sign in to comment.