跳到内容

dspy.disable_logging

dspy.disable_logging()

禁用 DSPy 中事件日志 API (eprint(), logger.info() 等) 所使用的 DSPyLoggingStream,从而静默所有后续事件日志。

源代码位于 dspy/utils/logging_utils.py
def disable_logging():
    """
    Disables the `DSPyLoggingStream` used by event logging APIs throughout DSPy
    (`eprint()`, `logger.info()`, etc), silencing all subsequent event logs.
    """
    DSPY_LOGGING_STREAM.enabled = False