move in open function

This commit is contained in:
WorldTeacher
2024-01-31 15:42:56 +01:00
parent bf1a3de8c2
commit d0a5ade15e

View File

@@ -3,8 +3,9 @@ import os
if not os.path.exists("logs"): if not os.path.exists("logs"):
os.mkdir("logs") os.mkdir("logs")
with open("logs/application.log", "w") as f: #open and close the file to create it
pass with open("logs/application.log", "w") as f:
pass
# Create a common file handler for all loggers # Create a common file handler for all loggers
common_file_handler = logging.FileHandler("logs/application.log") common_file_handler = logging.FileHandler("logs/application.log")