MCPcopy Create free account
hub / github.com/FreeformRobotics/OTS / setup_logger

Function setup_logger

utils.py:10–22  ·  view source on GitHub ↗
(distributed_rank=0, filename="log.txt")

Source from the content-addressed store, hash-verified

8
9
10def setup_logger(distributed_rank=0, filename="log.txt"):
11 logger = logging.getLogger("Logger")
12 logger.setLevel(logging.DEBUG)
13 # don't log results for the non-master process
14 if distributed_rank > 0:
15 return logger
16 ch = logging.StreamHandler(stream=sys.stdout)
17 ch.setLevel(logging.DEBUG)
18 fmt = "[%(asctime)s %(levelname)s %(filename)s line %(lineno)d %(process)d] %(message)s"
19 ch.setFormatter(logging.Formatter(fmt))
20 logger.addHandler(ch)
21
22 return logger
23
24
25def find_recursive(root_dir, ext='.jpg'):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected