Spaces:
Sleeping
Sleeping
Delete src/logger.py
Browse files- src/logger.py +0 -21
src/logger.py
DELETED
|
@@ -1,21 +0,0 @@
|
|
| 1 |
-
# Importing the required modules
|
| 2 |
-
import os
|
| 3 |
-
import logging
|
| 4 |
-
from datetime import datetime
|
| 5 |
-
|
| 6 |
-
# Creating a log file with the current date and time as the name of the file
|
| 7 |
-
LOG_FILE = f"{datetime.now().strftime('%m_%d_%Y_%H_%M_%S')}.log"
|
| 8 |
-
|
| 9 |
-
# Creating a logs folder if it does not exist
|
| 10 |
-
logs_path = os.path.join(os.getcwd(), "logs", LOG_FILE)
|
| 11 |
-
os.makedirs(logs_path, exist_ok=True)
|
| 12 |
-
|
| 13 |
-
# Setting the log file path and the log level
|
| 14 |
-
LOG_FILE_PATH = os.path.join(logs_path, LOG_FILE)
|
| 15 |
-
|
| 16 |
-
# Configuring the logger
|
| 17 |
-
logging.basicConfig(
|
| 18 |
-
filename=LOG_FILE_PATH,
|
| 19 |
-
format="[ %(asctime)s ] %(lineno)d %(name)s - %(levelname)s - %(message)s",
|
| 20 |
-
level=logging.INFO,
|
| 21 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|