0

Testing a flask-SocketIO app and I can't see any logs. It crashes but it doesn't write anything in my Konsole. What I only see is:

 ~/PycharmProjects/chat $ flask run
 * Serving Flask-SocketIO app "main.py"
 * Forcing debug mode off

Is it connected with Socket-IO library? Other Flask applications work normally and everything is shown in console.

VC.One
  • 14,790
  • 4
  • 25
  • 57
Desiigner
  • 2,136
  • 5
  • 26
  • 47

2 Answers2

2

you need to set debug to True. Do this:

export FLASK_APP=main.py
export FLASK_DEBUG=1
flask run

Now you will be able to see the verbose debug in your console.

user2906838
  • 1,178
  • 9
  • 20
  • I did it and I still can't see the traceback messages. It looks like this: * Serving Flask-SocketIO app "main.py" * Forcing debug mode on * Restarting with stat * Debugger is active! * Debugger PIN: 399-480-796 127.0.0.1 - - [2018-08-12 04:55:32] "POST / HTTP/1.1" 405 323 0.001283 127.0.0.1 - - [2018-08-12 04:55:51] "POST / HTTP/1.1" 405 323 0.001800 – Desiigner Aug 12 '18 at 01:57
  • these lines are shown when an error occurs – Desiigner Aug 12 '18 at 01:57
  • Yes, this is what you would see, the sever is returning 405 response code. If there was something in the code, it would show up. – user2906838 Aug 12 '18 at 02:01
2

In the terminal, type export FLASK_ENV=development

The development mode on Flask enables logging functionality and also a lot of developer helpful tools.