:debug completely deprecated in favour of DEBUG=
This commit is contained in:
		@@ -119,7 +119,7 @@ GNU AGPLv3 code
 | 
			
		||||
 | 
			
		||||
Further options:
 | 
			
		||||
- Change what morss does
 | 
			
		||||
- `debug`: to have some feedback from the script execution. Useful for debugging. NB. for cli use, set the environment variable `DEBUG=1`
 | 
			
		||||
- Environment variable `DEBUG=`: to have some feedback from the script execution. Useful for debugging. On Apache, can be set via the `SetEnv` instruction
 | 
			
		||||
- `silent`: don't output the final RSS (useless on its own, but can be nice when debugging)
 | 
			
		||||
- `callback=NAME`: for JSONP calls
 | 
			
		||||
- `cors`: allow Cross-origin resource sharing (allows XHR calls from other servers)
 | 
			
		||||
 
 | 
			
		||||
@@ -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']:
 | 
			
		||||
 
 | 
			
		||||
@@ -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))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user