aboutsummaryrefslogtreecommitdiffstats
path: root/python/utils/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/utils/__init__.py')
-rw-r--r--python/utils/__init__.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/python/utils/__init__.py b/python/utils/__init__.py
index 625e0f10..856e42f1 100644
--- a/python/utils/__init__.py
+++ b/python/utils/__init__.py
@@ -12,3 +12,13 @@ class SerenitasFileHandler(logging.FileHandler):
def __init__(self, log_file):
super().__init__(filename=os.path.join(os.getenv("LOG_DIR"), log_file))
self.setFormatter(SerenitasFileHandler._formatter)
+
+
+class SerenitasRotatingFileHandler(logging.RotatingFileHandler):
+ """simple class that encapsulates where we store our logs"""
+
+ def __init__(self, log_file, maxBytes=0):
+ super().__init__(
+ filename=os.path.join(os.getenv("LOG_DIR"), log_file), maxBytes=maxByes
+ )
+ self.setFormatter(SerenitasFileHandler._formatter)