mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 16:28:26 +00:00
refactor(plugins): reuse plugin loader logger adapter
This commit is contained in:
17
src/plugins/logger.ts
Normal file
17
src/plugins/logger.ts
Normal 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),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user