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

@ -41,7 +41,6 @@ export class Config {
}
private refreshLogging() {
log.setEnabled(this.traceExtension ?? false);
log.info(
"Extension version:",
vscode.extensions.getExtension(this.extensionId)!.packageJSON.version,
@ -253,10 +252,6 @@ export class Config {
await this.cfg.update("checkOnSave", !(value || false), target || null, overrideInLanguage);
}
get traceExtension() {
return this.get<boolean>("trace.extension");
}
get discoverProjectRunner(): string | undefined {
return this.get<string | undefined>("discoverProjectRunner");
}