text2sql-ai-agent / utils /logger.py
jaymeen1405's picture
Upload 39 files
58478b5 verified
Raw
History Blame Contribute Delete
379 Bytes
import logging
from config import BASE_DIR
log_dir = BASE_DIR / "logs"
log_dir.mkdir(exist_ok=True)
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s [%(levelname)s] %(name)s: %(message)s",
handlers=[
logging.FileHandler(log_dir / "app.log"),
logging.StreamHandler()
]
)
def get_logger(name: str):
return logging.getLogger(name)