Files
Mofox-Core/docs/plugins/api/logging-api.md
UnCLAS-Prommer e893b62580 logging_api_doc
2025-07-27 17:16:25 +08:00

561 B
Raw Blame History

Logging API

Logging API模块提供了获取本体logger的功能允许插件记录日志信息。

导入方式

from src.plugin_system.apis import logging_api
# 或者
from src.plugin_system import logging_api

主要功能

1. 获取本体logger

def get_logger(name: str) -> structlog.stdlib.BoundLogger:

获取本体logger实例。

Args:

  • name (str): 日志记录器的名称。

Returns:

  • 一个logger实例有以下方法:
    • debug
    • info
    • warning
    • error
    • critical