forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 15
WIP for console.group #749
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jasonLaster
wants to merge
1
commit into
webreplay-release
Choose a base branch
from
jasonLaster-patch-1
base: webreplay-release
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"groupCollapsed" ? 😁
😮 "table" ???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call. Here are more log levels from firefox
https://searchfox.org/mozilla-central/source/toolkit/modules/Console.jsm#285-304
https://searchfox.org/mozilla-central/source/devtools/client/webconsole/utils/messages.js#563-583
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had mentioned this in chat, but I'll note here that this is insufficient to capture the semantics of grouping, because we discard console messages sometimes, and grouping explicitly relies on opening and closing messages, so this on its own will easily cause the nesting of group/End messages to become mismatched, so this patch passes along grouping info, but then introduces a separate problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RE: Nesting:
I think it's probably reasonable to pass the potentially unmatched groups to the frontend and rely on it to do a smart thing (like ignoring group-close entries without group-opens, or auto-closing unclosed groups).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a little unclear to me if you are describing a case/scenario that I didn't list above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair, should have been clearer. It seems like the randomness of recordings and of recording region division mean that any particular log statement may end up falling into your "Ambiguous" item.
What I'm trying to illustrate with my examples is that I don't think we can fix the ambiguous cases, and I'm realizing a detail that I should have clarified, which is that the linker itself is what tracks
overflow, so when there are overflowing messages, we literally know nothing, even in the backend, about those messages, forWe do not have enough information in the backend to know how to do this for the ambiguous case, because we would need to know when groups may have been opened or closed in the overflowed messages.
So either the messages themselves need to know their depth, or the linker itself needs to track message depth for overflowing messages, even if it discards the message itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha. Thank you for distilling that.
I'm not sure what this means. Are you saying that the gecko/chromium/node would have to store this information at runtime/record-time?
I have no idea how much effort that would be. If it's easy to do, then– that would be a great option to have.
I think we might still be skipping past what the desired behavior is for the scenarios I raised above. Like maybe the thread moved forward under the assumption that preserving the indentation was definitely what we wanted to do– but I'm not sure it is.
For instance, what Chrome does when you clear the console feels somewhat analogous to how our focus window feature works? In this case, Chrome blows away the indentation:

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fair, I guess the core of what I want is to ensure that overflow doesn't cause us to lose information about group nesting, so I want to make sure that information comes through somewhere, so then the question is what should that information look like to get what we want. In your example above I'd think like:
I think I'd expect that either the frontend would indent
foo1to depth 1, or else it could choose to adjust the depths by recognizing that the firstgroupEnddidn't have a start, and would basically decide to ignore that groupEnd and adjust the depths of all the messages before the first groupEnd.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The frontend could detect and handle indentation for the scenario you've described– since the presence of a
groupEndimplies agroup(orgroupCollapsed– although this is kind of an interesting distinction TBH). What should the frontend do in this case:We can infer that there was a group but don't know that it was collapsed– and even if we could there would be nothing to show as the toggle header. (We wouldn't have the "Header text" string.)