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

VSCode language client should configure logger pointing to the output channel rather than console #1613

Open
JohnnyMorganz opened this issue Feb 8, 2025 · 2 comments
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities
Milestone

Comments

@JohnnyMorganz
Copy link

I recently received a user report of a bug in my language server, but the expected error log did not show in the configured output channel as I expected. Typically I direct users to look into this output channel when reporting issues.

I happened to find the error after I opened Developer: Toggle Developer Tools and saw the error log in the developer console, rather than the output channel:

Image

The logged error was a Received response message without id, and looking at the code this comes from a call to logger.error:

logger.error(`Received response message without id: Error is: \n${JSON.stringify(responseMessage.error, undefined, 4)}`);

Logger is configurable, and after looking around I found that the client configures the logger as a ConsoleLogger, which is why it ends up going to the developer console:

const logger = new ConsoleLogger();

What do you think about changing this to log into the vscode output channel rather than the console? I believe this will make the logs more visible for debugging

@dbaeumer
Copy link
Member

Actually makes perfect sense to change this to be logged into the Output channel.

@dbaeumer dbaeumer added feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities labels Feb 10, 2025
@dbaeumer dbaeumer added this to the On Deck milestone Feb 10, 2025
@dbaeumer
Copy link
Member

PR welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities
Projects
None yet
Development

No branches or pull requests

2 participants