CsWinRT icon indicating copy to clipboard operation
CsWinRT copied to clipboard

Logging doesn't work

Open mmarczell-graphisoft opened this issue 10 months ago • 2 comments

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

mmarczell-graphisoft avatar Apr 16 '24 11:04 mmarczell-graphisoft

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.

manodasanW avatar Apr 17 '24 04:04 manodasanW

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?

mmarczell-graphisoft avatar Apr 17 '24 13:04 mmarczell-graphisoft