2

将 quart 服务器与 Telethon 库一起使用时遇到问题,但无法处理该错误。试图打开调试模式,但它说Warning: The config 调试has no affect when using serve warnings.warn("The config调试 has no affect when using serve", Warning)

这是我的代码:

quart_cfg = hypercorn.Config()
quart_cfg.bind = ["0.0.0.0:8000"]
quart_cfg.debug = True
app = Quart(__name__)
...
async def main():
    await hypercorn.asyncio.serve(app,quart_cfg)
if __name__ == '__main__':
    client.loop.run_until_complete(main())

如何查看来自 quart 服务器的日志?也许我可以使用其他东西而不是服务功能?也找不到任何文档..

4

1 回答 1

4

您可以通过设置为实现与调试标志相同的效果loop.set_debug(debug)

quart_cfg = hypercorn.Config()
quart_cfg.bind = ["0.0.0.0:8000"]
app = Quart(__name__)
...
async def main():
    await hypercorn.asyncio.serve(app,quart_cfg)

if __name__ == '__main__':
    client.loop.set_debug(True)
    client.loop.run_until_complete(main())
于 2020-08-04T19:38:20.477 回答