microsoft / microsoft/microsoft-ui-xaml
DebugSettings.LayoutCycleTracingLevel doesn't work as docs claim
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
### Describe the bug
The [docs](https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.debugsettings.layoutcycletracinglevel?view=windows-app-sdk-1.5#remarks) for `DebugSettings.LayoutCycleTracingLevel` imply that the information will be added to Stowed Exceptions, but this doesn't seem to be the case
### Steps to reproduce the bug
1. create a blank app with a button which will induce a layout cycle crash:
```
class WinUILayoutCycleButton: Button {
override func onPointerPressed(_: PointerRoutedEventArgs!) throws {
layoutUpdated.addHandler { [weak self] _, _ in
try? self?.invalidateMeasure()
}
width = width - 1
}
}
```
2. click the button to induce a layout cycle crash
3. look at the dmp file, there isn't more stowed exception information
### Expected behavior
I would expect the stowed exception information to be included in the dump.
### Screenshots
_No response_
### NuGet package version
WinUI 3 - Windows App SDK 1.5.6: 1.5.240802000
### Windows version
_No response_
### Additional context
I've seen the tracing output, but in order to get that you need a debugger attached, or do something like detour `OutputDebugString` to collect the logs (assuming that's the API being used, I don't think this code is open source).
It would be nice to have a logging API, somewhat similar to `DebugSettings.BindingFailed` or `DebugSettings.XamlResourceReferenceFailed`
Contributor guide
Research direction
Start with the LayoutCycleTracingLevel remarks in the linked documentation and reproduce the issue using the provided WinUILayoutCycleButton example. Capture the resulting dump and compare its stowed exception information with the tracing output observed under a debugger or through OutputDebugString. Done means the documented behavior is verified and the implementation or documentation accurately reflects whether tracing appears in dumps.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100