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

Support VS Code 'Set Log Level'

Open juvtib opened this issue 2 years ago • 2 comments

Prerequisites

  • [X] I have written a descriptive issue title.
  • [X] I have searched all issues to ensure it has not already been reported.

Summary

VS Code version 1.76 has a "Developer: Set Log Level..." command. I tried using the command while I had a PowerShell project loaded. But I did not see an explicit option for the PowerShell extension. I'm not sure if the extension outputs to a generic log or if the PowerShell extension should be represented on this list.

Screen capture of VS Code log menu. There is no menu item for the PowerShell extension.

'Set Log Level' seems like a useful command. Please take a look at it and see if the PowerShell extension can support this VS Code command.

References

Proposed Design

No response

juvtib avatar Mar 03 '23 09:03 juvtib

Thanks for the Issue Submit!

So this is a fairly new API that logging has to be explicitly written for: https://code.visualstudio.com/updates/v1_73#_log-output-channel

The PowerShell extension has its own logger implementation and would need to be updated for this new API. https://vscode.dev/github/powershell/vscode-powershell/blob/019a9f8cf8509eaffff994af82b804b39e19d883/src/logging.ts#L49

And then wired up so that writeAtLevel and writeLine and related code paths submit properly to the output channel api, then the existing log level setting would need to be retired.

JustinGrote avatar Apr 10 '23 04:04 JustinGrote

Thanks for taking a look at it.

For reference, here is that logging line without Visual Studio Code for the Web. https://github.com/PowerShell/vscode-powershell/blob/019a9f8cf8509eaffff994af82b804b39e19d883/src/logging.ts#L49

juvtib avatar Apr 11 '23 01:04 juvtib