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

feat: use vscode log format for client logs #17722

Merged
merged 2 commits into from
Jul 29, 2024
Merged

Conversation

joshka
Copy link
Contributor

@joshka joshka commented Jul 28, 2024

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.

Motivation:
The large uncolored unformatted log output with a large config object logged whenever it changes has always dominated the logs. This subjectively has made it that looking to see what the client is doing has always been a bit disappointing. That said, there's only 17 log messages total in the client. Hopefully by making the logs more visually useful this will encourage adding more appropriate debug level messages in future.

Incidentally, it might be worth only logging the config change message at a debug level instead of an info level to reduce the noise.

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.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 28, 2024
@joshka
Copy link
Contributor Author

joshka commented Jul 28, 2024

Screenshot 2024-07-27 at 9 31 10 PM

@joshka
Copy link
Contributor Author

joshka commented Jul 28, 2024

image

@Veykril
Copy link
Member

Veykril commented Jul 29, 2024

Thanks!
@bors r+

@bors
Copy link
Collaborator

bors commented Jul 29, 2024

📌 Commit 917ed63 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Jul 29, 2024

⌛ Testing commit 917ed63 with merge 2c68c9a...

@bors
Copy link
Collaborator

bors commented Jul 29, 2024

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 2c68c9a to master...

@bors bors merged commit 2c68c9a into rust-lang:master Jul 29, 2024
11 checks passed
@joshka joshka deleted the jm/logs branch August 1, 2024 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants