in pyrela/common_utils/logger.py [0:0]
def __init__(self, path, mode="w"):
assert mode in {"w", "a"}, "unknown mode for logger %s" % mode
self.terminal = sys.stdout
if not os.path.exists(os.path.dirname(path)):
os.makedirs(os.path.dirname(path))
if mode == "w" or not os.path.exists(path):
self.log = open(path, "w")
else:
self.log = open(path, "a")