:debug completely deprecated in favour of DEBUG=

This commit is contained in:
2020-08-23 14:33:32 +02:00
parent 6dd40e5cc4
commit f65fb45030
3 changed files with 7 additions and 5 deletions

View File

@@ -39,8 +39,11 @@ def cgi_parse_environ(environ):
# get options
if 'REQUEST_URI' in environ:
# when running on Apache
url = environ['REQUEST_URI'][1:]
else:
# when using internal server
url = environ['PATH_INFO'][1:]
if environ['QUERY_STRING']:

View File

@@ -39,14 +39,13 @@ class MorssException(Exception):
def log(txt):
if ('DEBUG' in os.environ
or ':debug' in os.environ.get('REQUEST_URI', '')
or ':debug' in os.environ.get('PATH_INFO', '')
):
if 'DEBUG' in os.environ:
if 'REQUEST_URI' in os.environ:
# when running on Apache
open('morss.log', 'a').write("%s\n" % repr(txt))
else:
# when using internal server or cli
print(repr(txt))