From e93d1fc4dca884542ad57f15bb8350b99c3b8244 Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Thu, 4 Jul 2019 11:26:11 +0200 Subject: [PATCH] Adjusted the plug-in related logging. - Got rid of the empty lines between the log entries. - Log the plug-in `name` and `version` when initializing. Signed-off-by: Akos Kitta --- .../plugin-ext/src/hosted/node/hosted-plugin-process.ts | 6 +++--- packages/plugin-ext/src/hosted/node/plugin-host-rpc.ts | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/plugin-ext/src/hosted/node/hosted-plugin-process.ts b/packages/plugin-ext/src/hosted/node/hosted-plugin-process.ts index e8cda321abfe3..8d9bf44aab475 100644 --- a/packages/plugin-ext/src/hosted/node/hosted-plugin-process.ts +++ b/packages/plugin-ext/src/hosted/node/hosted-plugin-process.ts @@ -24,7 +24,7 @@ import { HostedPluginClient, ServerPluginRunner, PluginMetadata, PluginHostEnvir import { RPCProtocolImpl } from '../../api/rpc-protocol'; import { MAIN_RPC_CONTEXT } from '../../api/plugin-api'; import { HostedPluginCliContribution } from './hosted-plugin-cli-contribution'; -import {HostedPluginProcessesCache} from './hosted-plugin-processes-cache'; +import { HostedPluginProcessesCache } from './hosted-plugin-processes-cache'; export interface IPCConnectionOptions { readonly serverName: string; @@ -180,8 +180,8 @@ export class HostedPluginProcess implements ServerPluginRunner { } const childProcess = cp.fork(path.resolve(__dirname, 'plugin-host.js'), options.args, forkOptions); - childProcess.stdout.on('data', data => this.logger.info(`[${options.serverName}: ${childProcess.pid}] ${data.toString()}`)); - childProcess.stderr.on('data', data => this.logger.error(`[${options.serverName}: ${childProcess.pid}] ${data.toString()}`)); + childProcess.stdout.on('data', data => this.logger.info(`[${options.serverName}: ${childProcess.pid}] ${data.toString().trim()}`)); + childProcess.stderr.on('data', data => this.logger.error(`[${options.serverName}: ${childProcess.pid}] ${data.toString().trim()}`)); this.logger.debug(`[${options.serverName}: ${childProcess.pid}] IPC started`); childProcess.once('exit', () => this.logger.debug(`[${options.serverName}: ${childProcess.pid}] IPC exited`)); diff --git a/packages/plugin-ext/src/hosted/node/plugin-host-rpc.ts b/packages/plugin-ext/src/hosted/node/plugin-host-rpc.ts index e7eb192e9c9fb..411a8c3799435 100644 --- a/packages/plugin-ext/src/hosted/node/plugin-host-rpc.ts +++ b/packages/plugin-ext/src/hosted/node/plugin-host-rpc.ts @@ -67,7 +67,8 @@ export class PluginHostRPC { // tslint:disable-next-line:no-any initContext(contextPath: string, plugin: Plugin): any { - console.log('PLUGIN_HOST(' + process.pid + '): initializing(' + contextPath + ')'); + const { name, version } = plugin.rawModel; + console.log('PLUGIN_HOST(' + process.pid + '): initializing(' + name + '@' + version + ' with ' + contextPath + ')'); try { const backendInit = require(contextPath); backendInit.doInitialization(this.apiFactory, plugin);