We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8713843 commit 4b7d9a2Copy full SHA for 4b7d9a2
1 file changed
src/logger.py
@@ -3,8 +3,9 @@
3
import os
4
5
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
6
+LOG_DIR = os.path.join(ROOT_DIR, 'logs')
7
# Create a logs directory if it doesn't exist
-os.makedirs(os.path.join(ROOT_DIR, 'logs'), exist_ok=True)
8
+os.makedirs(LOG_DIR, exist_ok=True)
9
10
# Log Formatter with datetime, log level, and message
11
formatter = logging.Formatter(
@@ -14,7 +15,7 @@
14
15
16
# File handler for logging to a file
17
file_handler = RotatingFileHandler(
- 'logs/app_debug.log',
18
+ os.path.join(LOG_DIR, 'app_debug.log'),
19
maxBytes=10 * 1024 * 1024, # 10 MB per log file
20
backupCount=5 # Keep up to 5 old log files
21
)
0 commit comments