Display messages issued from debugger log points with a dedicated icon
Categories
(DevTools :: Console, enhancement, P2)
Tracking
(Not tracked)
People
(Reporter: nchevobbe, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
Jason thinks it would be nice if those messages have a different look, and I agree.
IMO, we could adapt the purple breakpoint icon in the console.
I'll try to check if we have all the info we need to do that on the frontend.
It would be really nice if we have this in the same version logpoints are added in the console.
| Reporter | ||
Comment 1•7 years ago
|
||
Florens, any objection in using an adapted purple-breakpoint icon in the console?
| Reporter | ||
Comment 2•7 years ago
|
||
Here's the packet we get from the server:
{
"message": {
"filename": "https://nchevobbe.github.io/demo/console-test-event-listeners.js",
"lineNumber": 6,
"columnNumber": 6,
"arguments": [
"click click"
],
"workerType": "none",
"sourceId": null,
"styles": [],
"category": "webdev"
},
"type": "consoleAPICall"
}
So, there isn't any field that would allow us to target them for now.
Here's where the message is issued: devtools/server/actors/breakpoint.js#231-237.
The packet ends up being constructed in devtools/server/actors/webconsole.js#1686 ’s prepareConsoleMessageForRemote.
We can see here that it looks for a message.category field, which defaults to "webdev".
So, in breakpoint.js, we should add a category: "debugger" property into the message, so it would be sent to the frontend, where we could add a proper CSS class on it.
Updated•7 years ago
|
Comment 3•7 years ago
|
||
Thanks Nicholas for kicking this off.
Just for planning: In the future, we might allow users to pick the console message type. So users can treat branches of statements or promises as warnings or errors and filter them easier.
Not just treating them as logs brings some interesting conflicts with filtering. With that added complexity and since there are no custom actions on the log entries; I would treat this as optional enhancements. With smaller scope, maybe we could consider sth light that adds a flag to the log, vs a new type?
| Reporter | ||
Comment 4•7 years ago
|
||
This could roughly look like this
Comment 5•7 years ago
|
||
My gut reaction is that we have too many different icons already, so I'm not fond of adding one. :)
More precisely, some possible issues:
- Our gutter icons map more or less well to the log "types" available as filters. We have a few ambiguous things already, like Logs/Debug (no icon, so they can be hard to tell apart), and Warnings/CSS. Ideally I'd like to resolve those ambiguous things, and not add more.
- Using a specific icon would conflict with the plans that Harald described.
- Since we're using this "breakpoint" icon mostly for actions (click to add or remove a breakpoint; click to disable/enable all breakpoints), and not as an annotation, I'm afraid users would understand that this icon is clickable.
I think we should explore other ways to convey where the logs come from. The right-hand location seems like the logical place where we could stress that information.
Comment 6•7 years ago
•
|
||
Just a bit of brainstorming. Keeping the normal icon (or no icon for log/debug levels) in the gutter, we could add a purple bullet to the message body. I'm using roughly the same style as the ":hover", ":focus" etc. markers in the Inspector's markup view.
(Example has a console.debug and other cruft, please disregard that. ^^)
| Reporter | ||
Comment 7•7 years ago
|
||
This was done as part of another bug
Description
•