我是hypercorn++新手。我正在嘗試創(chuàng)建以下文件并在路由處理程序中打印一些信息/調(diào)試日志,但沒(méi)有顯示任何內(nèi)容。我已調(diào)試到路由處理程序并注意到. 有誰(shuí)知道有什么問(wèn)題嗎?謝謝!uvloopquartdog_server.logger.disabled = Truedog_blueprint.pyfrom quart import Blueprintimport logginglogging.basicConfig(level=logging.DEBUG)class DogBlueprint(Blueprint): logger = None app_config = None def register(self, app, options, first_registration: bool = False): # app.logger.info('DogBlueprint is registering') print('Blueprint registering...') self.logger = app.logger self.logger.info("Hello") # This one working fine self.app_config = app.config super(DogBlueprint, self).register(app, options, first_registration) self.logger.info("World") # This one working fineroute.pydog_server = DogBlueprint('dog_server', __name__)logging.basicConfig(level=logging.DEBUG)@dog_server.route('/score', methods=['POST'])async def post_handler(): received = await _fetch_post_body(request) dog_server.logger.info(f'Received size: {len(received)}') # This one does not work ... ...
添加回答
舉報(bào)
0/150
提交
取消