LCA-PORVID's picture
Upload 34 files
ebdb5af verified
raw
history blame contribute delete
745 Bytes
import os
import logging
def setup_logger(CURRENT_PATH, CURRENT_TIME):
print(
f"Logging to {os.path.join(CURRENT_PATH, 'out', str(CURRENT_TIME), 'logs', 'log.txt')}")
logging.basicConfig(filename=os.path.join(CURRENT_PATH, "out", str(CURRENT_TIME), "logs", "log.txt"), filemode='w',
format='%(asctime)s - %(levelname)s - %(message)s',
level=logging.INFO)
def create_output_dir(CURRENT_PATH, CURRENT_TIME):
os.mkdir(os.path.join(CURRENT_PATH,
"out", str(CURRENT_TIME)))
os.mkdir(os.path.join(CURRENT_PATH, "out",
str(CURRENT_TIME), "logs"))
os.mkdir(os.path.join(CURRENT_PATH, "out",
str(CURRENT_TIME), "models"))