Skip to content

Commit

Permalink
local time zone added to message logging
Browse files Browse the repository at this point in the history
  • Loading branch information
DogukanUrker committed Jan 16, 2024
1 parent dbb4537 commit 869bb0d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import secrets
import sqlite3
from os import mkdir
from time import tzname
from random import randint
from os.path import exists
from datetime import datetime
Expand Down Expand Up @@ -35,6 +36,10 @@
)


def currentTimeZone():
return tzname[0]


def currentDate():
return datetime.now().strftime("%d.%m.%y")

Expand All @@ -60,8 +65,10 @@ def message(color, message):
logFile = open(LOG_FILE_ROOT, "a", encoding="utf-8")
logFile.write(
f"[{currentDate()}"
f"|{currentTime(seconds=True,microSeconds=True)}]"
f" {message}\n"
f"|{currentTime(seconds=True,microSeconds=True)}"
f"|{currentTimeZone()}]"
"\t"
f"{message}\n"
)
logFile.close()

Expand Down

0 comments on commit 869bb0d

Please sign in to comment.