all repos — listfix @ 18547b97d19fc759c0ec99998196c22591f477bf

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

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()