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
new file mode 100644
index 00000000..84ab4b13
--- /dev/null
+++ b/python/utils/__init__.py
@@ -0,0 +1,10 @@
+import logging
+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: str):
+ super().__init__(filename=os.path.join(os.getenv("LOG_DIR"), log_file))
+ self.setFormatter(SerenitasFileHandler._formatter)