Skip to main content

init_logging

Function init_logging 

Source
pub fn init_logging() -> UnboundedReceiver<LogEntry>
Expand description

初始化插件日志系统。

§返回值

返回 mpsc::UnboundedReceiver<LogEntry>,调用方需要 spawn 一个后台任务消费该通道, 将 WARN/ERROR 日志转发到宿主。

§Panics

如果全局 subscriber 已被设置(例如在测试中),try_init() 会静默忽略。