hardhat-vscode icon indicating copy to clipboard operation
hardhat-vscode copied to clipboard

Log to file

Open kanej opened this issue 3 years ago • 0 comments
trafficstars

This issue has been separated out of the #74 PR to improve logging.

The rust extension and the typescript extension are examples of extensions which give the option of logging to file from their settings.

The intention would be to do something similar. The initial idea was to redirect the output-channel to file, using a wrapper round the channel. The issue is that channels work across workspace folder, so where should the log file reside?

There are internal vscode log file for the output channels of extensions, these can be found with the Developer: Open extensions log file command, but these are not gauranteed to be written (them may be retained entirely in memory).

Based on my attempt I think the likely best approach is to separate out the output channel from logging, and log per workspace folder/lsp. The lsp will log to the root and will do so on the server side. The output-channel will include more information (lsp message tracing for example).

A potential alternative is to explore adding file logging to the vscode-language-server-node project itself and then take advantage of it.

kanej avatar Feb 21 '22 12:02 kanej