MCPcopy Create free account
hub / github.com/M-Nauta/ProtoTree / __init__

Method __init__

util/log.py:12–24  ·  view source on GitHub ↗
(self, log_dir: str)

Source from the content-addressed store, hash-verified

10 """
11
12 def __init__(self, log_dir: str): # Store log in log_dir
13
14 self._log_dir = log_dir
15 self._logs = dict()
16
17 # Ensure the directories exist
18 if not os.path.isdir(self.log_dir):
19 os.mkdir(self.log_dir)
20 if not os.path.isdir(self.metadata_dir):
21 os.mkdir(self.metadata_dir)
22 if not os.path.isdir(self.checkpoint_dir):
23 os.mkdir(self.checkpoint_dir)
24 open(self.log_dir + '/log.txt', 'w').close() #make log file empty if it already exists
25
26 @property
27 def log_dir(self):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected