[70b6b3]: / logger.py

Download this file

15 lines (11 with data), 313 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
import sys
class Logger(object):
def __init__(self, path):
self.terminal = sys.stdout
self.log = open(path, 'a')
def write(self, message):
self.terminal.write(message)
self.log.write(message)
def flush(self):
# needed for python 3 compatibility
pass