PowerShell / PowerShellEditorServices

A common platform for PowerShell development support in any editor or application!
MIT License
637 stars 220 forks source link

Remove Serilog, implement HostLogger integration, and deprecate net6.0 #2197

Closed JustinGrote closed 2 weeks ago

JustinGrote commented 2 weeks ago

Eliminate Serilog dependencies and wire up HostLogger to MEL directly after initialization.

I confirmed the HostLogger logs are showing up on the other side (this is using the new logoutputwindow on the vscode side but should look fine with the old LSP trace as well)

image

This shows where the file based logging stops and then resumes inside LSP communication image

As part of the resolutions, this also drops net6.0 support due to some library changes (which was going to happen anyways as net6.0 is EOL as of November)

Fixes https://github.com/PowerShell/vscode-powershell/issues/5084

JustinGrote commented 2 weeks ago

Test for the debug adapter is stuck on reading the stream for some reason... https://github.com/PowerShell/PowerShellEditorServices/blob/3335b32742b63e90c9c5bd2db0252614fa4adc14/test/PowerShellEditorServices.Test.E2E/Processes/LoggingStream.cs#L42-L43

EDIT: StdioServerProcess used for testing has some loggerfactory references still. I'll investigate tomorrow. Should still be good for review, works otherwise for LSP and DAP as far as I can tell, just a faulty test.

dkattan commented 2 weeks ago

This is awesome! Serilog version mismatches have caused lots of issues for us when launching from our parent project.

JustinGrote commented 2 weeks ago

I'm having issues with this test even on main, and I suspect it has to do with this deadlock weirdness. image

JustinGrote commented 2 weeks ago

@andyleejordan this should be ready but it needs a package update to run tests. Failed to retrieve information about 'Microsoft.Extensions.Logging.Debug' from remote source 'https://pkgs.dev.azure.com/powershell/2972bb5c-f20c-4a60-8bd9-00ffe9987edc/_packaging/e59e749b-417c-4664-9322-c190bb60de7f/nuget/v3/flat2/microsoft.extensions.logging.debug/index.json'.

I can remove MEL.Debug if you want but I hope to expand it more throughout the extension.