Sphinx 生成的文档不显示记录器的消息(python 代码块)

问题描述 投票:0回答:0

我有一段 python 代码使用日志包返回 INFO 消息 (

logging.info(f"Parameter already present.")
)。但是当我在 python 代码块中运行该代码时(使用
.. ipython:: python
指令),未显示日志消息。或者使用更小的 MWE:

.. ipython:: python
  
  import logging
  logging.info("test logging")
  print("test print")

仅给出打印语句(“测试打印”)的输出。我怎样才能让狮身人面像显示日志消息?

python-3.x logging sphinx
© www.soinside.com 2019 - 2024. All rights reserved.