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

Make IPC debug tracing configurable #9602

Merged
merged 1 commit into from
Jun 18, 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 examples/electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"bundle": "theia build --mode development",
"watch": "concurrently -n compile,bundle \"theiaext watch --preserveWatchOutput\" \"theia build --watch --mode development\"",
"start": "theia start --plugins=local-dir:../../plugins",
"start:debug": "yarn start --log-level=debug",
"start:debug": "yarn start --log-level=debug --remote-debugging-port=9222",
paul-marechal marked this conversation as resolved.
Show resolved Hide resolved
"test": "electron-mocha --timeout 60000 \"./lib/test/**/*.espec.js\""
},
"devDependencies": {
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
"publish:check": "node scripts/check-publish.js",
"start:browser": "yarn rebuild:browser && yarn --cwd examples/browser start",
"start:electron": "yarn rebuild:electron && yarn --cwd examples/electron start",
"debug:browser": "yarn rebuild:browser && yarn --cwd examples/browser start:debug",
"debug:electron": "yarn rebuild:electron && yarn --cwd examples/electron start:debug",
"download:plugins": "theia download:plugins"
},
"workspaces": [
Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/node/messaging/ipc-connection-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ export class IPCConnectionProvider {
info: (message: string) => this.logger.info(`[${options.serverName}: ${childProcess.pid}] ${message}`),
log: (message: string) => this.logger.info(`[${options.serverName}: ${childProcess.pid}] ${message}`)
});
connection.trace(Trace.Off, {
const traceVerbosity = this.logger.isDebug() ? Trace.Verbose : Trace.Off;
connection.trace(traceVerbosity, {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
log: (message: any, data?: string) => this.logger.info(`[${options.serverName}: ${childProcess.pid}] ${message}` + (typeof data === 'string' ? ' ' + data : ''))
log: (message: any, data?: string) => this.logger.debug(`[${options.serverName}: ${childProcess.pid}] ${message}` + (typeof data === 'string' ? ' ' + data : ''))
});
return connection;
}
Expand Down