MCPcopy Create free account
hub / github.com/ImprintLab/Medical-SAM2 / create_logger

Function create_logger

func_3d/utils.py:42–54  ·  view source on GitHub ↗
(log_dir, phase='train')

Source from the content-addressed store, hash-verified

40 return net
41
42def create_logger(log_dir, phase='train'):
43 time_str = time.strftime('%Y-%m-%d-%H-%M')
44 log_file = '{}_{}.log'.format(time_str, phase)
45 final_log_file = os.path.join(log_dir, log_file)
46 head = '%(asctime)-15s %(message)s'
47 logging.basicConfig(filename=str(final_log_file),
48 format=head)
49 logger = logging.getLogger()
50 logger.setLevel(logging.INFO)
51 console = logging.StreamHandler()
52 logging.getLogger('').addHandler(console)
53
54 return logger
55
56def set_log_dir(root_dir, exp_name):
57 path_dict = {}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected