diff --git a/modules/pytorch_jacinto_ai/xnn/utils/logger.py b/modules/pytorch_jacinto_ai/xnn/utils/logger.py
index 7818563d52db910501e08bb681c4df487813720b..27b9371f5e16204692c43f8cc7c502bd7e9b1ee6 100644 (file)
class TeeLogger:
- def __init__(self, filename, log_level=logging.INFO):
+ def __init__(self, filename, log_level=logging.INFO, append=False):
assert log_level == logging.INFO, 'for now we support only INFO logging level'
+ mode = "a" if append else "w"
self.term = sys.stdout
- self.file = open(filename, "w")
+ self.file = open(filename, mode)
sys.stdout = self
self.count = 0