Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
searx-engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
searx-engine
Commits
6cbd29f6
Commit
6cbd29f6
authored
Jan 09, 2015
by
Adam Tauber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[enh] logging added
parent
3b672039
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
__init__.py
searx/__init__.py
+11
-1
No files found.
searx/__init__.py
View file @
6cbd29f6
...
@@ -15,9 +15,9 @@ along with searx. If not, see < http://www.gnu.org/licenses/ >.
...
@@ -15,9 +15,9 @@ along with searx. If not, see < http://www.gnu.org/licenses/ >.
(C) 2013- by Adam Tauber, <asciimoo@gmail.com>
(C) 2013- by Adam Tauber, <asciimoo@gmail.com>
'''
'''
import
logging
from
os
import
environ
from
os
import
environ
from
os.path
import
realpath
,
dirname
,
join
,
abspath
from
os.path
import
realpath
,
dirname
,
join
,
abspath
from
searx.https_rewrite
import
load_https_rules
try
:
try
:
from
yaml
import
load
from
yaml
import
load
except
:
except
:
...
@@ -45,7 +45,17 @@ else:
...
@@ -45,7 +45,17 @@ else:
with
open
(
settings_path
)
as
settings_yaml
:
with
open
(
settings_path
)
as
settings_yaml
:
settings
=
load
(
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
# load https rules only if https rewrite is enabled
if
settings
.
get
(
'server'
,
{})
.
get
(
'https_rewrite'
):
if
settings
.
get
(
'server'
,
{})
.
get
(
'https_rewrite'
):
# loade https rules
# loade https rules
from
searx.https_rewrite
import
load_https_rules
load_https_rules
(
https_rewrite_path
)
load_https_rules
(
https_rewrite_path
)
logger
.
info
(
'Initialisation done'
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment