From c9a959f0872dda4f55d7aefc32442464102f5be1 Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Tue, 28 Jul 2020 23:08:04 +0300 Subject: [PATCH] Add --debug option to server to log tracebacks on failures podman build . -t cheat.sh podman run -it --rm -p 8002 cheat.sh bin/srv.py --debug https://stackoverflow.com/questions/26026148/how-to-run-wsgiserver-in-verbose-or-debug-mode --- bin/srv.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/srv.py b/bin/srv.py index cbedae0..77c3286 100644 --- a/bin/srv.py +++ b/bin/srv.py @@ -274,6 +274,9 @@ def answer(topic=None): return result return Response(result, mimetype='text/plain') + +if '--debug' in sys.argv: + app.debug = True if 'CHEATSH_PORT' in os.environ: PORT = int(os.environ.get('CHEATSH_PORT')) else: