Skip to content

Use VS Code's LogOutputChannel for logging #553

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

EhabY
Copy link

@EhabY EhabY commented Jul 15, 2025

closes #257

In this PR I create a LogOutputChannel instead of the old OutputChannel. By default, appendLine uses the info logging level so I used info to log most messages, except errors where the error level was used.

I think all of the info can be downgraded into debug level actually, and the errors could be downgraded into warn since they are handled or thrown right away. What do you think?

@matifali matifali requested review from code-asher and aslilac and removed request for code-asher July 15, 2025 21:02
Copy link
Member

@code-asher code-asher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had no idea this existed! Awesome.

@code-asher
Copy link
Member

Ah and I mentioned info already but to this point:

the errors could be downgraded into warn since they are handled or thrown right away. What do you think?

I think you are right, looking at the error calls, warn feels appropriate to me for these

@EhabY
Copy link
Author

EhabY commented Jul 16, 2025

Probably requires another review now that I replaced all the calls of storage.writeToCoderOutputChannel

@matifali matifali requested a review from code-asher July 16, 2025 17:12
Copy link
Member

@code-asher code-asher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@matifali
Copy link
Member

HI @EhabY. Thanks for your contribution. Could you also add the change to https://github.com/coder/vscode-coder/blob/main/CHANGELOG.md
I am ssuming that the usuall way to do it @code-asher

@EhabY
Copy link
Author

EhabY commented Jul 17, 2025

Added the change to the changlog

@code-asher
Copy link
Member

Ah right yeah, adding a line to the changelog in the PR is the best way yeah.

CHANGELOG.md Outdated
Comment on lines 7 to 8
- Use `LogOutputChannel` for the Coder output channel and ensure messages are logged
with the appropriate log level.
Copy link
Member

@code-asher code-asher Jul 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would word it to be more user-centric, like how does this affect the user and what can/should they do about it?

Something like this maybe:

Respect log levels.  In the Coder output panel, you can now select the log level to filter messages.

Copy link
Author

@EhabY EhabY Jul 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the following:

Coder output panel enhancements: All log entries now include timestamps, and you can filter messages by log level in the panel.

@EhabY EhabY force-pushed the use-logging-output-vscode branch from 71d9254 to 029711f Compare July 18, 2025 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include timestamps in Coder extension logs
4 participants