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

Function create_logger

func_2d/utils.py:179–191  ·  view source on GitHub ↗
(log_dir, phase='train')

Source from the content-addressed store, hash-verified

177
178
179def create_logger(log_dir, phase='train'):
180 time_str = time.strftime('%Y-%m-%d-%H-%M')
181 log_file = '{}_{}.log'.format(time_str, phase)
182 final_log_file = os.path.join(log_dir, log_file)
183 head = '%(asctime)-15s %(message)s'
184 logging.basicConfig(filename=str(final_log_file),
185 format=head)
186 logger = logging.getLogger()
187 logger.setLevel(logging.INFO)
188 console = logging.StreamHandler()
189 logging.getLogger('').addHandler(console)
190
191 return logger
192
193
194def set_log_dir(root_dir, exp_name):

Callers 2

mainFunction · 0.90
mainFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected