feat: use vscode log format for client logs

This change updates the log format to use the vscode log format instead
of the custom log format, by replacing the `OutputChannel` with a
`LogOutputChannel` and using the `debug`, `info`, `warn`, and `error`
methods on it. This has the following benefits:

- Each log level now has its own color and the timestamp is in a more
  standard format
- Inspect output (e.g. the log of the config object) is now colored
- Error stack traces are now shown in the output
- The log level is now controlled on the output tab by clicking the gear
  icon and selecting "Debug" or by passing the `--log` parameter to
  vscode. The `trace.extension` setting has been marked as deprecated.
This commit is contained in:
Josh McKinney 2024-07-27 21:43:35 -07:00
parent a46788318c
commit 45a881313a
No known key found for this signature in database
GPG key ID: 722287396A903BC5
6 changed files with 44 additions and 46 deletions

View file

@ -117,9 +117,11 @@ export function isValidExecutable(path: string, extraEnv: Env): boolean {
env: { ...process.env, ...extraEnv },
});
const printOutput = res.error ? log.warn : log.info;
printOutput(path, "--version:", res);
if (res.error) {
log.warn(path, "--version:", res);
} else {
log.info(path, "--version:", res);
}
return res.status === 0;
}