aboutsummaryrefslogtreecommitdiff
path: root/bootstrap.py
blob: cadefccad7e7a4f4047c8165d24460583bcd38bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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