Closed Bug 1751281 Opened 2 years ago Closed 2 years ago

Enable logging Windows messages without changing #defines

Categories

(Core :: Widget: Win32, enhancement, P2)

Unspecified
Windows
enhancement

Tracking

()

RESOLVED FIXED
100 Branch
Tracking Status
firefox100 --- fixed

People

(Reporter: handyman, Assigned: mvollmer, Mentored)

References

Details

Attachments

(1 file)

It would be great if we could more robustly log Windows messages for debugging. There is existing code that does some mild symbolification of events and logs that to the console. It requires changing some #defines -- it isn't even built into debug builds without this. This bug is about EVENT_DEBUG_OUTPUT.

The log provides a lot of value. it collates windows message logging with Firefox logging (unlike Spy++), which is required to get most of the debugging value. it also allows bug reporters to record logs that can be used to track down rare bugs that are only seen on a few machines. Users cannot easily install Spy++ since it requires installing Visual Studio (!)

The current logging code seems to predate bug #s in checkin comments. The closest I've been able to get is here. I assume that the build limitations were based on a desire to keep the binary small by not including the strings, but this shouldn't still be a big deal (is this string table more than a couple of kilobytes?).

The symbolification also does no logging of additional parameters that are message-type-specific. Some of these values, like WM_WINDOWPOSCHANGING window dimensions or WM_DPICHANGED numbers would help immensely in debugging things like rare multi-monitor bugs. Putting this message-type to parameter-type association would be best done generically (instead of in each WM_* handler) to limit the spread of the logging code and because most events could be handled essentially identically.

Logging these messages produces a ton of output. If we are to make event logging always available then we should move it to a different log so that the "Widget" log can continue to be used normally. I'd suggest two new logs, since mouse events should be considered separate. They really spam. (Right now, this is controlled by yet another #define.)

Severity: -- → S4
Priority: -- → P2

From what I understand, we basically should have a separate MOZ_LOG target like "WidgetEvents" and "WidgetMouseEvents" and record the above there.

Mentor: davidp99
Assignee: nobody → mvollmer
Status: NEW → ASSIGNED

It would also be cool if we logged our response, aRetValue.

Attachment #9268852 - Attachment description: WIP: Bug 1751281 - Enable Windows Event logging with separate logging module and message parameters → Bug 1751281 - Enable Windows Event logging with separate logging module and message parameters r=cmartin
Pushed by gpascutto@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ca296f209b26
Enable Windows Event logging with separate logging module and message parameters r=cmartin
Regressions: 1761509
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 100 Branch
See Also: → 1788271
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: