listfix/log.py (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
class Log:
def __init__(self):
self.log_file = open("/tmp/listfix_log.txt", "a")
def info(self, txt):
txt = txt.rstrip()
self.log_file.write(f"[INFO] {txt}\n")
def error(self, txt):
txt = txt.rstrip()
self.log_file.write(f"[ERROR] {txt}\n")
def debug(self, txt):
txt = txt.rstrip()
self.log_file.write(f"[DEBUG] {txt}\n")
def close(self):
self.log_file.close()
|