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__.py35
1 files changed, 0 insertions, 35 deletions
diff --git a/python/utils/__init__.py b/python/utils/__init__.py
deleted file mode 100644
index 3e5a0de1..00000000
--- a/python/utils/__init__.py
+++ /dev/null
@@ -1,35 +0,0 @@
-import logging
-import logging.handlers
-import os
-
-
-class SerenitasFileHandler(logging.FileHandler):
- """simple class that encapsulates where we store our logs"""
-
- _formatter = logging.Formatter(
- "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
- )
-
- def __init__(self, log_file):
- if "LOG_DIR" not in os.environ:
- base_dir = os.path.expanduser("~")
- else:
- base_dir = os.getenv("LOG_DIR")
- super().__init__(filename=os.path.join(base_dir, log_file))
- self.setFormatter(SerenitasFileHandler._formatter)
-
-
-class SerenitasRotatingFileHandler(logging.handlers.RotatingFileHandler):
- """simple class that encapsulates where we store our logs"""
-
- def __init__(self, log_file, maxBytes=0, backupCount=0):
- if "LOG_DIR" not in os.environ:
- base_dir = os.path.expanduser("~")
- else:
- base_dir = os.getenv("LOG_DIR")
- super().__init__(
- filename=os.path.join(base_dir, log_file),
- maxBytes=maxBytes,
- backupCount=backupCount,
- )
- self.setFormatter(SerenitasFileHandler._formatter)