将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())
如何查看夸脱服务器中的日志?也许我可以使用其他功能而非服务功能?也找不到任何文档。
答案 0 :(得分:1)
通过将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())