Skip to content

Commit

Permalink
Update logger
Browse files Browse the repository at this point in the history
  • Loading branch information
aturret committed Nov 25, 2024
1 parent 1a1c293 commit 5cdbdf8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions app/utils/logger.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
import logging
import os

import loguru
from loguru import logger

from app.config import LOG_LEVEL, LOG_FILE_PATH

logger = loguru.logger
log_path = os.path.join(LOG_FILE_PATH, "app.log")

logger.add(
log_path,
level=LOG_LEVEL,
rotation="1 week",
retention="10 days",
compression="zip",
)
logger.debug(f"Logger initialized with level: {LOG_LEVEL}")
logger.debug(f"Logger initialized with log file path: {log_path}")

0 comments on commit 5cdbdf8

Please sign in to comment.