Files
openclaw/src/plugins/logger.ts
2026-06-04 04:36:44 -04:00

20 lines
595 B
TypeScript

// Builds plugin-scoped loggers for runtime and setup code.
import type { PluginLogger } from "./types.js";
type LoggerLike = {
info: (message: string) => void;
warn: (message: string) => void;
error: (message: string) => void;
debug?: (message: string) => void;
};
/** Adapts a generic logger to the plugin loader logger interface. */
export function createPluginLoaderLogger(logger: LoggerLike): PluginLogger {
return {
info: (msg) => logger.info(msg),
warn: (msg) => logger.warn(msg),
error: (msg) => logger.error(msg),
debug: (msg) => logger.debug?.(msg),
};
}