This commit is contained in:
Saif Mahmud
2024-05-25 23:31:28 -05:00
committed by GitHub
parent 824b0e85f0
commit 0f3e92108f

View File

@@ -16,5 +16,5 @@ class FileHandler:
def log(self, **kwargs):
now = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
message = f"{now}: ".join([f"{key}={value}" for key, value in kwargs.items()])
with open(self._path, "a") as file:
with open(self._path, "a", encoding = 'utf-8') as file:
file.write(message + "\n")