Logger.write() also calls print()

This commit is contained in:
randomuser 2021-07-29 23:49:31 -05:00
parent 17ac6cccba
commit 3db7b43c72
1 changed files with 2 additions and 4 deletions

View File

@ -86,22 +86,20 @@ class Logger:
return int(time.time())
def write(self, msg):
if self.fd: self.fd.write("{}\n")
if self.fd: self.fd.write("{}\n".format(msg))
print("{}".format(msg))
def log(self, msg):
ct = self.time()
self.write("[{}] {}".format(str(ct), msg))
print("[{}] {}".format(str(ct), msg))
def warn(self, msg):
ct = self.time()
self.write("! [{}] {}".format(str(ct), msg))
print("! [{}] {}".format(str(ct), msg))
def error(self, msg):
ct = self.time()
self.write("!! [{}] {}".format(str(ct), msg))
print("!! [{}] {}".format(str(ct), msg))
self.close()
raise SystemExit