mirror of
https://github.com/penpot/penpot-mcp.git
synced 2026-04-25 11:18:37 +00:00
PluginBridge: Improve logging
This commit is contained in:
parent
45f8c9b1df
commit
c2484f312a
@ -51,9 +51,9 @@ export class PluginBridge {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (userToken) {
|
if (userToken) {
|
||||||
this.logger.info("New WebSocket connection established (authenticated)");
|
this.logger.info("New WebSocket connection established (token provided)");
|
||||||
} else {
|
} else {
|
||||||
this.logger.info("New WebSocket connection established (unauthenticated)");
|
this.logger.info("New WebSocket connection established");
|
||||||
}
|
}
|
||||||
|
|
||||||
// register the client connection with both indexes
|
// register the client connection with both indexes
|
||||||
@ -70,12 +70,12 @@ export class PluginBridge {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ws.on("message", (data: Buffer) => {
|
ws.on("message", (data: Buffer) => {
|
||||||
this.logger.info("Received WebSocket message: %s", data.toString());
|
this.logger.debug("Received WebSocket message: %s", data.toString());
|
||||||
try {
|
try {
|
||||||
const response: PluginTaskResponse<any> = JSON.parse(data.toString());
|
const response: PluginTaskResponse<any> = JSON.parse(data.toString());
|
||||||
this.handlePluginTaskResponse(response);
|
this.handlePluginTaskResponse(response);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error(error, "Failed to parse WebSocket message");
|
this.logger.error(error, "Failure while processing WebSocket message");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user