Skip to content

Commit

Permalink
logger added
Browse files Browse the repository at this point in the history
  • Loading branch information
shaheennabi committed Dec 2, 2024
1 parent 1fdbcc9 commit a1c5783
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/finetuning/logger/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import logging
import os
from datetime import datetime
from from_root import from_root


LOG_FILE = f"{datetime.now().strftime('%m_%d_%Y_%H_%M_%S')}.log"

log_path = os.path.join(from_root(), 'log', LOG_FILE)

os.makedirs(log_path, exist_ok=True)

lOG_FILE_PATH = os.path.join(log_path, LOG_FILE)

logging.basicConfig(
filename=lOG_FILE_PATH,
format= "[ %(asctime)s ] %(name)s - %(levelname)s - %(message)s",
level= logging.INFO
)

0 comments on commit a1c5783

Please sign in to comment.