add some logging to ipc object channels

This commit is contained in:
Benjamin Pasero 2021-03-31 13:24:37 +02:00
parent 1d883f8af1
commit 203f1cb56b
No known key found for this signature in database
GPG key ID: E6380CC4C8219E65

View file

@ -155,10 +155,16 @@ export class ProtocolMainService extends Disposable implements IProtocolMainServ
const handler = async (): Promise<T> => obj;
ipcMain.handle(channel, handler);
this.logService.trace(`IPC Object URL: Registered new channel ${channel}.`);
return {
resource,
update: updatedObj => obj = updatedObj,
dispose: () => ipcMain.removeHandler(channel)
dispose: () => {
this.logService.trace(`IPC Object URL: Removed channel ${channel}.`);
ipcMain.removeHandler(channel);
}
};
}