diff options
author | Cédric Bonhomme <kimble.mandel+bitbucket@gmail.com> | 2014-06-09 19:05:32 +0200 |
---|---|---|
committer | Cédric Bonhomme <kimble.mandel+bitbucket@gmail.com> | 2014-06-09 19:05:32 +0200 |
commit | 1b73a3a4a73f231f6c1c2a3258e561b1301ca6af (patch) | |
tree | ea21bacea92a0a267f8286eb12f2d81cefa1a3c4 /bootstrap.py | |
parent | A problem with urllib.quote() has been detected with the url: http://standblo... (diff) | |
parent | fixing parsing for already quoted url as well (diff) | |
download | newspipe-1b73a3a4a73f231f6c1c2a3258e561b1301ca6af.tar.gz newspipe-1b73a3a4a73f231f6c1c2a3258e561b1301ca6af.tar.bz2 newspipe-1b73a3a4a73f231f6c1c2a3258e561b1301ca6af.zip |
Merged in jaesivsm/pyaggr3g470r (pull request #2)
making pyagregator runnable by apache
Diffstat (limited to 'bootstrap.py')
-rw-r--r-- | bootstrap.py | 22 |
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) |