microsoft / CsWinRT

C# language projection for the Windows Runtime
MIT License
542 stars 103 forks source link

Logging doesn't work #1572

Open mmarczell-graphisoft opened 5 months ago

mmarczell-graphisoft commented 5 months ago

Describe the bug No log.txt is generated despite me enabling CsWinRTEnableLogging

To Reproduce

  1. Clone example project at https://github.com/mmarczell-graphisoft/winrtbug
  2. Build the WinUI project.
  3. No log.txt is generated

Expected behavior Because of the CsWinRTEnableLogging flag being set in the csproj, a log.txt should be generated.

Version Info CsWinRT 2.0.7

manodasanW commented 5 months ago

CsWinRTEnableLogging is for enabling logging during CsWinRT component authoring scenarios to debug issues in the component source generator. From looking at your sample, it looks like you are just creating a projection to consume a native WinRT component. For debugging issues in these scenarios, I would suggest capturing a binlog.

mmarczell-graphisoft commented 5 months ago

I think it would still be useful to have some minimal amount of logging even in this scenario. For example in https://github.com/microsoft/CsWinRT/issues/1543, it would be useful if I could look at the log and see what command line arguments cswinrt.exe is being called with. Or is that also included in a MSBuild log?