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:
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
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 Toolsand saw the error log in the developer console, rather than the output channel:The logged error was a
Received response message without id, and looking at the code this comes from a call tologger.error:vscode-languageserver-node/jsonrpc/src/common/connection.ts
Line 909 in d810d51
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:vscode-languageserver-node/client/src/common/client.ts
Line 2409 in d810d51
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