mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 21:01:26 +00:00
fix: log plugin load errors in gateway
This commit is contained in:
@@ -29,10 +29,19 @@ export function loadGatewayPlugins(params: {
|
||||
const gatewayMethods = Array.from(new Set([...params.baseMethods, ...pluginMethods]));
|
||||
if (pluginRegistry.diagnostics.length > 0) {
|
||||
for (const diag of pluginRegistry.diagnostics) {
|
||||
const details = [
|
||||
diag.pluginId ? `plugin=${diag.pluginId}` : null,
|
||||
diag.source ? `source=${diag.source}` : null,
|
||||
]
|
||||
.filter((entry): entry is string => Boolean(entry))
|
||||
.join(", ");
|
||||
const message = details
|
||||
? `[plugins] ${diag.message} (${details})`
|
||||
: `[plugins] ${diag.message}`;
|
||||
if (diag.level === "error") {
|
||||
params.log.warn(`[plugins] ${diag.message}`);
|
||||
params.log.error(message);
|
||||
} else {
|
||||
params.log.info(`[plugins] ${diag.message}`);
|
||||
params.log.info(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user