Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run WSGIServer in verbose or debug mode ?

I'm using the following code snippet to run WSGIServer in python:

from bottle import request, Bottle, abort
app = Bottle()

.. other stuff ... 

from gevent.pywsgi import WSGIServer
from geventwebsocket import WebSocketError
from geventwebsocket.handler import WebSocketHandler
server = WSGIServer(("0.0.0.0", 8080), app,
                    handler_class=WebSocketHandler)
server.serve_forever()

The server works fine but every time I send a request to this server, there is nothing printed out on console (the way bottle or flask do when you run their server directly). Those console logs would really help me understand what requests the browser is making. I tried inserting debug=True in several places in above code, but none seemed to work. What am I doing wrong ?

like image 824
G.A. Avatar asked Mar 18 '23 09:03

G.A.


1 Answers

I believe you should add this line before starting the server .
app.debug = True

like image 50
Alexander Avatar answered Apr 29 '23 07:04

Alexander