我正在使用Python Bottle运行服务器。它工作得非常好,但是它会将它处理的每个请求记录到控制台,这会减慢它的速度。有没有办法指示不将这些日志发送到控制台?
示例代码:
from bottle import route, run
@route('/')
def index():
return 'Hello, world!'
run(host = 'localhost', port = 8080)
示例输出(每次向localhost:8080/
发出请求时都会得到):
127.0.0.1 - - [06/Jun/2015 11:23:24] "GET / HTTP/1.1" 200 244
答案 0 :(得分:6)
将quiet
参数添加到run
来电:
from bottle import route, run
@route('/')
def index():
return 'Hello, world!'
run(host = 'localhost', port = 8080, quiet=True)
请参阅API reference。