跳转到正文

diagnostics API ​

完整接口目录 · 插件运行时用法 · 工具包下载

模块说明 ​

text
Bounded JSON diagnostics on stderr, independent of root logging and IPC.

Use get_logger('my-plugin').info('started', extra={'event': 'plugin.started'}),
or Worker.log after construction. Enable debug with log.setLevel(logging.DEBUG).
Only event and operation_id extras are emitted. Never pass commands, payloads,
credentials or environment values as log messages/arguments. Exception output
contains types and stack locations, never locals, source lines or error text.

MAX_RECORD_BYTES ​

python
MAX_RECORD_BYTES = 16 * 1024

get_logger ​

python
def get_logger(
    name = 'plugin',
    *,
    installation_id = None,
    generation = None,
    level = logging.INFO,
)

SDK 说明:

text
Return an independent LoggerAdapter; repeat calls never add handlers.

Metadata is optional until handshake. Worker.log binds the host identity
automatically. Explicit helpers can bind a known session using the keyword
arguments here. Each adapter owns its level; no global logger is configured.

Neomega · 使用、开发与参考文档