我正在使用python并请求module == 2.18.4
在使用请求抓取某些数据时,我使用了日志记录模块进行调试.
我希望日志看起来像这样:
[DEBUG] 2018-01-25 03:15:36,940 http://localhost:8888 "GET /aaa" 200 2290
[DEBUG] 2018-01-25 03:15:36,940 http://localhost:8888 "GET /aaa" 200 2290
[DEBUG] 2018-01-25 03:15:36,940 http://localhost:8888 "GET /aaa" 200 2290
Run Code Online (Sandbox Code Playgroud)
但我明白了:
[DEBUG] 2018-01-25 03:15:36,940 http://localhost:8888 "GET /aaa" 200 2290
[DEBUG] 2018-01-25 03:15:36,974 EUC-JP Japanese prober hit error at byte 1765
[DEBUG] 2018-01-25 03:15:36,990 EUC-KR Korean prober hit error at byte 1765
[DEBUG] 2018-01-25 03:15:36,994 CP949 Korean prober hit error at byte 1765
[DEBUG] 2018-01-25 03:15:37,009 EUC-TW Taiwan prober hit error at …Run Code Online (Sandbox Code Playgroud) 运行flask应用程序时,例如
...
if __name__ is "__main__":
app.run(port=self.port)
...
Run Code Online (Sandbox Code Playgroud)
有一些关于运行的消息。
* Serving Flask app "__main__" (lazy loading)
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
Run Code Online (Sandbox Code Playgroud)
我如何禁用所有这些消息?