Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: printout whole received event in debug log #67

Merged
merged 1 commit into from
Feb 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sap-devx/webview-rpc",
"version": "0.3.0",
"version": "0.3.1",
"description": "An RPC library for VSCode WebViews",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/rpc-browser-ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class RpcBrowserWebSockets extends RpcCommon {
this.ws = ws;
this.ws.addEventListener("message", (event) => {
const message: any = JSON.parse(event.data as string);
this.logger.debug(`Event Listener: Received event: ${message.command} id: ${message.id} method: ${message.method} params: ${JSON.stringify(message.params)}`);
this.logger.debug(`Event Listener: Received event: ${JSON.stringify(message)}`);
switch (message.command) {
case "rpc-response":
this.handleResponse(message);
Expand Down
2 changes: 1 addition & 1 deletion src/rpc-browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class RpcBrowser extends RpcCommon {
this.vscode = vscode;
this.window.addEventListener("message", (event) => {
const message = event.data;
this.logger.debug(`Event Listener: Received event: ${message.command} id: ${message.id} method: ${message.method} params: ${JSON.stringify(message.params)}`);
this.logger.debug(`Event Listener: Received event: ${JSON.stringify(message)}`);
switch (message.command) {
case "rpc-response":
this.handleResponse(message);
Expand Down
2 changes: 1 addition & 1 deletion src/rpc-extension-ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class RpcExtensionWebSockets extends RpcCommon {
this.ws.on("message", message => {
// assuming message is a stringified JSON
const messageObject: any = JSON.parse(message as string);
this.logger.debug(`Event Listener: ${messageObject.command} id: ${messageObject.id} method: ${messageObject.method} params: ${messageObject.params}`);
this.logger.debug(`Event Listener: Received event: ${message as string}`);
switch (messageObject.command) {
case "rpc-response":
this.handleResponse(messageObject);
Expand Down
2 changes: 1 addition & 1 deletion src/rpc-extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class RpcExtension extends RpcCommon {
this.logger = logger.getChildLogger({ label: RpcExtension.className });
this.webview = webview;
this.webview.onDidReceiveMessage(message => {
this.logger.debug(`Event Listener: Received event: ${message.command} id: ${message.id} method: ${message.method} params: ${JSON.stringify(message.params)}`);
this.logger.debug(`Event Listener: Received event: ${JSON.stringify(message)}`);
switch (message.command) {
case "rpc-response":
this.handleResponse(message);
Expand Down