File size: 745 Bytes
ebdb5af | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 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"))
|