refactor(plugins): reuse plugin loader logger adapter

This commit is contained in:
Peter Steinberger
2026-02-18 23:47:59 +00:00
parent a8ebe942aa
commit aa8f87a3bf
6 changed files with 47 additions and 24 deletions

17
src/plugins/logger.ts Normal file
View File

@@ -0,0 +1,17 @@
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),
};
}