all repos — listfix @ b61c76044a547c3b44bc4a660adbb6c038980f09

Postfix Mailing List Software; Maintained on behalf the of Agency Economy Incorporated NFP.

Add date and time to log module

	modified:   listfix/log.py
Brian Barto bartobrian@gmail.com
Fri, 01 Apr 2022 16:05:21 -0400
commit

b61c76044a547c3b44bc4a660adbb6c038980f09

parent

63a355332186545a1acf216d5b36253ce4d54ef5

1 files changed, 4 insertions(+), 1 deletions(-)

jump to
M listfix/log.pylistfix/log.py

@@ -1,3 +1,5 @@

+from datetime import datetime + class Log: def __init__(self):

@@ -5,8 +7,9 @@ self.log_file = "/tmp/listfix_log.txt"

def write(self, type, txt): txt = txt.rstrip() + date = datetime.now() f = open(self.log_file, "a") - f.write(f"[{type}] {txt}\n") + f.write(f"[{type}] {date}, {txt}\n") f.close() def info(self, txt):