如何防止Python Bottle向控制台报告每个请求?

Tom*_*Tom 3 python bottle

我正在使用Python Bottle运行服务器.它工作得非常好,但是它会将它处理的每个请求记录到控制台,这会减慢它的速度.有没有办法指示它不要将这些日志发送到控制台?

示例代码:

from bottle import route, run
@route('/')
def index():
    return 'Hello, world!'
run(host = 'localhost', port = 8080)
Run Code Online (Sandbox Code Playgroud)

示例输出(每次发出请求时都会得到localhost:8080/):

127.0.0.1 - - [06/Jun/2015 11:23:24] "GET / HTTP/1.1" 200 244
Run Code Online (Sandbox Code Playgroud)

Rol*_*ith 6

quiet参数添加到run调用中:

from bottle import route, run

@route('/')
def index():
    return 'Hello, world!'

run(host = 'localhost', port = 8080, quiet=True)
Run Code Online (Sandbox Code Playgroud)

请参阅API参考.