Files
Moltbot/src/plugins/logger.ts
2026-02-18 23:48:32 +00:00

18 lines
465 B
TypeScript

import type { PluginLogger } from "./types.js";
type LoggerLike = {
info: (message: string) => void;
warn: (message: string) => void;
error: (message: string) => void;
debug?: (message: string) => void;
};
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),
};
}