GMC-IQA / utils /log_writer.py
Zevin2023's picture
MoC-IQA
07e1105
raw
history blame
323 Bytes
import sys
class Logger(object):
def __init__(self, filename="Default.log"):
self.terminal = sys.stdout
self.log = open(filename, "w")
def write(self, message):
self.terminal.write(message)
self.log.write(message)
self.flush()
def flush(self):
self.log.flush()