具体代码如下所示:
import sys
import os
class Logger(object):
def __init__(self, filename=Default.log):
self.terminal = sys.stdout
self.log = open(filename, a)
def write(self, message):
self.terminal.write(message)
self.log.write(message)
def flush(self):
pass
path = os.path.ab
1