Closed Bug 1581418 Opened 2 years ago Closed 2 years ago

Include more properties when logging objects

Categories

(Core Graveyard :: Web Replay, enhancement)

enhancement
Not set
normal

Tracking

(firefox71 fixed)

RESOLVED FIXED
mozilla71
Tracking Status
firefox71 --- fixed

People

(Reporter: bhackett1024, Assigned: bhackett1024)

References

Details

Attachments

(1 file)

When logging objects to the console with console.log() or with logpoints, we try to retain enough information about the object's properties to show a one-line inline preview for the logged object. There are a couple problems with this approach:

  • We don't necessarily have enough information for custom object previewers to work, and a more generic previewer will be used. The results can be pretty lame: for example, logging an event while not replaying shows the event kind, target DOM object, coordinates of mouse events, etc., while when replaying we end up with a nearly empty MouseEvent preview.

  • Expanding the object does not show anything, because we don't retain all the object's properties and report an empty set when the server asks to enumerate all of them.

The associated patch improves both of these situations: Event objects (though not all others with custom previews) show up with appropriate contents in the inline preview, and logged objects can be expanded to see their properties. We aren't able to support all the custom previewers (in particular, those for DOM nodes), and aren't able to show all the contents of objects like sets/maps, but this patch also performs a fair amount of cleanup to make these easier to support in the future.

Pushed by bhackett@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ece44b8f51e4
Include more properties when logging objects, r=jlast.
Backout by malexandru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ef4bc62d1776
Backed out changeset ece44b8f51e4 for causing xpcshell failures.
Pushed by malexandru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6c6c2a82876f
Include more properties when logging objects, r=jlast.
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
Flags: needinfo?(bhackett1024)
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.