(distributed_rank=0, filename="log.txt")
| 8 | |
| 9 | |
| 10 | def 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 | |
| 25 | def find_recursive(root_dir, ext='.jpg'): |
nothing calls this directly
no outgoing calls
no test coverage detected