/** * Module-level logger for the openclaw-bytedance plugin. * * The OpenClaw host hands the plugin a `PluginLogger` only at `register(api)` * time. Provider plugins (web search / media understanding) are plain data * objects whose runtime methods are invoked later by the host without a * logger argument, so we capture the host logger at registration time and * expose it through this module to the runtime files. * * Design: * - Default is a no-op so unit tests / direct imports never crash. * - `setPluginLogger(api.logger)` is called from `index.ts` register(). * - All log lines are prefixed with `[bytedance] ...` to match OpenClaw's * extension convention (matches `extensions/voice-call`, * `extensions/memory-core`, etc). * - `debug` is optional on `PluginLogger`, so we forward it through `?.` * and silently drop debug lines when the host did not wire a debug sink. */ /** Minimal subset of openclaw's PluginLogger we depend on. */ export interface PluginLoggerLike { debug?: (message: string) => void; info: (message: string) => void; warn: (message: string) => void; error: (message: string) => void; } /** Inject the host-provided logger. Called once from `index.ts#register`. */ export declare function setPluginLogger(logger: PluginLoggerLike | undefined): void; /** Reset to no-op (useful for tests). */ export declare function resetPluginLogger(): void; export declare const log: { debug(message: string): void; info(message: string): void; warn(message: string): void; error(message: string): void; }; /** * Format an error/exception consistently for log output. * Keeps it short (no stack flood) while preserving useful detail. */ export declare function formatErr(err: unknown): string; //# sourceMappingURL=logger.d.ts.map