aboutsummaryrefslogtreecommitdiff
path: root/bootstrap.py
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap.py')
-rw-r--r--bootstrap.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/bootstrap.py b/bootstrap.py
new file mode 100644
index 00000000..cadefcca
--- /dev/null
+++ b/bootstrap.py
@@ -0,0 +1,22 @@
+# required imports and code exection for basic functionning
+
+import sys
+if 'threading' in sys.modules:
+ raise Exception('threading module loaded before patching!')
+import gevent.monkey
+gevent.monkey.patch_thread()
+
+import conf
+import logging
+
+
+def set_logging(log_path, log_level=logging.INFO,
+ log_format='%(asctime)s %(levelname)s %(message)s'):
+ logger = logging.getLogger('pyaggr3g470r')
+ formater = logging.Formatter(log_format)
+ handler = logging.FileHandler(log_path)
+ handler.setFormatter(formater)
+ logger.addHandler(handler)
+ logger.setLevel(log_level)
+
+set_logging(conf.LOG_PATH)
bgstack15