From 37368a16f9d0a8707486445b3849ec64c6b0513f Mon Sep 17 00:00:00 2001 From: Andy Loftus Date: Thu, 11 Jan 2024 04:30:26 +0000 Subject: [PATCH] enable debug based on loglvl --- jiracmdline/app.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/jiracmdline/app.py b/jiracmdline/app.py index 910e71f..40a5348 100755 --- a/jiracmdline/app.py +++ b/jiracmdline/app.py @@ -9,14 +9,16 @@ logfmt = '%(levelname)s:%(funcName)s[%(lineno)d] %(message)s' loglvl = logging.INFO -loglvl = logging.DEBUG +# loglvl = logging.DEBUG logging.basicConfig( level=loglvl, format=logfmt ) logging.getLogger( 'libjira' ).setLevel( loglvl ) logging.getLogger( 'jira.JIRA' ).setLevel( loglvl ) app = flask.Flask( __name__ ) app.secret_key = secrets.token_hex() -# Tell flask_login to put "next" in the session instead of GET args +if loglvl == logging.DEBUG: + app.debug = True +# Tell flask_login to put "next" in the session, instead of, in the args to GET app.config['USE_SESSION_FOR_NEXT'] = True login_manager = flask_login.LoginManager( app=app ) login_manager.login_view = "login" @@ -277,4 +279,4 @@ def do_summary(): if __name__ == '__main__': - app.run( debug=True ) + app.run()