mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-21 09:40:13 +00:00
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:
parent
a46788318c
commit
45a881313a
6 changed files with 44 additions and 46 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue