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

Reduce plugin logging to debug level #12224

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
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export class PluginVsCodeDirectoryHandler implements PluginDeployerDirectoryHand
plugin.rootPath = plugin.path();
plugin.updatePath(pluginPath);
}
console.log(`Resolved "${plugin.id()}" to a VS Code extension "${pck.name}@${pck.version}" with engines:`, pck.engines);
console.debug(`Resolved "${plugin.id()}" to a VS Code extension "${pck.name}@${pck.version}" with engines:`, pck.engines);
return true;
}

Expand Down
10 changes: 6 additions & 4 deletions packages/plugin-ext/src/hosted/browser/hosted-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ export class HostedPluginSupport {
const loadPluginsMeasurement = this.measure('loadPlugins');

const hostContributions = new Map<PluginHost, PluginContributions[]>();
console.log(`[${this.clientId}] Loading plugin contributions`);
for (const contributions of this.contributions.values()) {
const plugin = contributions.plugin.metadata;
const pluginId = plugin.model.id;
Expand All @@ -384,7 +385,7 @@ export class HostedPluginSupport {
contributions.push(Disposable.create(() => console.log(`[${pluginId}]: Unloaded plugin.`)));
contributions.push(this.contributionHandler.handleContributions(this.clientId, contributions.plugin));
contributions.state = PluginContributions.State.LOADED;
console.log(`[${this.clientId}][${pluginId}]: Loaded contributions.`);
console.debug(`[${this.clientId}][${pluginId}]: Loaded contributions.`);
loaded++;
}

Expand All @@ -396,7 +397,7 @@ export class HostedPluginSupport {
hostContributions.set(host, dynamicContributions);
toDisconnect.push(Disposable.create(() => {
contributions!.state = PluginContributions.State.LOADED;
console.log(`[${this.clientId}][${pluginId}]: Disconnected.`);
console.debug(`[${this.clientId}][${pluginId}]: Disconnected.`);
}));
}
}
Expand Down Expand Up @@ -446,14 +447,15 @@ export class HostedPluginSupport {
if (toDisconnect.disposed) {
return;
}
console.log(`[${this.clientId}] Starting plugins.`);
for (const contributions of hostContributions) {
started++;
const plugin = contributions.plugin;
const id = plugin.metadata.model.id;
contributions.state = PluginContributions.State.STARTED;
console.log(`[${this.clientId}][${id}]: Started plugin.`);
console.debug(`[${this.clientId}][${id}]: Started plugin.`);
toDisconnect.push(contributions.push(Disposable.create(() => {
console.log(`[${this.clientId}][${id}]: Stopped plugin.`);
console.debug(`[${this.clientId}][${id}]: Stopped plugin.`);
manager.$stop(id);
})));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export class HostedPluginDeployerHandler implements PluginDeployerHandler {
deployed.contributes = this.reader.readContribution(manifest);
this.localizationService.deployLocalizations(deployed);
deployedPlugins.set(id, deployed);
deployPlugin.log(`Deployed ${entryPoint} plugin "${id}" from "${metadata.model.entryPoint[entryPoint] || pluginPath}"`);
deployPlugin.debug(`Deployed ${entryPoint} plugin "${id}" from "${metadata.model.entryPoint[entryPoint] || pluginPath}"`);
} catch (e) {
deployPlugin.error(`Failed to deploy ${entryPoint} plugin from '${pluginPath}' path`, e);
return success = false;
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-ext/src/hosted/node/plugin-host-rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class PluginHostRPC {

initContext(contextPath: string, plugin: Plugin): void {
const { name, version } = plugin.rawModel;
console.log('PLUGIN_HOST(' + process.pid + '): initializing(' + name + '@' + version + ' with ' + contextPath + ')');
console.debug('PLUGIN_HOST(' + process.pid + '): initializing(' + name + '@' + version + ' with ' + contextPath + ')');
try {
const backendInit = dynamicRequire<{ doInitialization: BackendInitializationFn }>(contextPath);
backendInit.doInitialization(this.apiFactory, plugin);
Expand All @@ -111,7 +111,7 @@ export class PluginHostRPC {
const pluginManager = new PluginManagerExtImpl({
// eslint-disable-next-line @typescript-eslint/no-explicit-any
loadPlugin(plugin: Plugin): any {
console.log('PLUGIN_HOST(' + process.pid + '): PluginManagerExtImpl/loadPlugin(' + plugin.pluginPath + ')');
console.debug('PLUGIN_HOST(' + process.pid + '): PluginManagerExtImpl/loadPlugin(' + plugin.pluginPath + ')');
// cleaning the cache for all files of that plug-in.
Object.keys(require.cache).forEach(function (key): void {
const mod: NodeJS.Module = require.cache[key]!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class PluginTheiaDirectoryHandler implements PluginDeployerDirectoryHandl

accept(resolvedPlugin: PluginDeployerEntry): boolean {

console.log('PluginTheiaDirectoryHandler: accepting plugin with path', resolvedPlugin.path());
console.debug('PluginTheiaDirectoryHandler: accepting plugin with path', resolvedPlugin.path());

// handle only directories
if (resolvedPlugin.isFile()) {
Expand Down