type Level = 'VERBOSE' | 'SUCCESS' | 'INFO' | 'WARN' | 'FATAL'; /** * 日志配置 */ export type LogConfig = { /** * @internal * 名称(与 topic 组合为 name#topic,多/单设备对齐用 SmartDevicesManager) * @default SDM */ name?: string; /** * @internal * # 后的事件/类型(如 onDpDataChange、dpDataChange),与 name 组合为 name#topic */ topic?: string; /** * @internal * 可选标签,存在时追加 " by label"(如拦截器名 dp-kit) */ label?: string; /** * 日志输出级别,默认 INFO */ level?: Level; /** * @internal * 日志作用域,配合 setSdmLogScopeMuted 可在进入多设备页等场景下静音单设备 log */ scope?: string; }; /** * 按 scope 静音/恢复日志。例如进入多设备页时静音单设备:setSdmLogScopeMuted('single', true),离开时恢复 false。 */ export declare function setSdmLogScopeMuted(scope: string, muted: boolean): void; export declare const createLogger: (cfg?: LogConfig) => { verbose: (text: string, ...args: any[]) => void; success: (text: string, ...args: any[]) => void; info: (text: string, ...args: any[]) => void; warn: (text: string, ...args: any[]) => void; fatal: (text: string, ...args: any[]) => void; }; export declare const noopLogger: { verbose: () => void; success: () => void; info: () => void; warn: () => void; fatal: () => void; }; export declare const log: { verbose: (text: string, ...args: any[]) => void; success: (text: string, ...args: any[]) => void; info: (text: string, ...args: any[]) => void; warn: (text: string, ...args: any[]) => void; fatal: (text: string, ...args: any[]) => void; }; export {};