diff options
| author | Thomas Pointhuber <thomas.pointhuber@gmx.at> | 2015-01-09 21:25:13 +0100 |
|---|---|---|
| committer | Thomas Pointhuber <thomas.pointhuber@gmx.at> | 2015-01-09 21:30:09 +0100 |
| commit | 400b54191c590663f0cfe91045f70a5d9223aa19 (patch) | |
| tree | 08c71466ac8fbaf69872f114847baec762f5bd81 /searx/__init__.py | |
| parent | af8dac93a8acff5042b7b399c38e348f0bdc32ad (diff) | |
| parent | c8be128e97479ea6c871c4b6fbf014fa8136e708 (diff) | |
Merge branch 'master' of https://github.com/asciimoo/searx into code_results
Conflicts:
searx/engines/searchcode_code.py
searx/engines/searchcode_doc.py
searx/static/oscar/js/searx.min.js
searx/templates/oscar/result_templates/default.html
searx/templates/oscar/result_templates/images.html
searx/templates/oscar/result_templates/map.html
searx/templates/oscar/result_templates/torrent.html
searx/templates/oscar/result_templates/videos.html
Diffstat (limited to 'searx/__init__.py')
| -rw-r--r-- | searx/__init__.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/searx/__init__.py b/searx/__init__.py index 46685817a..110f46af8 100644 --- a/searx/__init__.py +++ b/searx/__init__.py @@ -15,9 +15,9 @@ along with searx. If not, see < http://www.gnu.org/licenses/ >. (C) 2013- by Adam Tauber, <asciimoo@gmail.com> ''' +import logging from os import environ from os.path import realpath, dirname, join, abspath -from searx.https_rewrite import load_https_rules try: from yaml import load except: @@ -45,7 +45,17 @@ else: with open(settings_path) as settings_yaml: settings = load(settings_yaml) +if settings.get('server', {}).get('debug'): + logging.basicConfig(level=logging.DEBUG) +else: + logging.basicConfig(level=logging.WARNING) + +logger = logging.getLogger('searx') + # load https rules only if https rewrite is enabled if settings.get('server', {}).get('https_rewrite'): # loade https rules + from searx.https_rewrite import load_https_rules load_https_rules(https_rewrite_path) + +logger.info('Initialisation done') |