Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign updevtools: Implemented `console.group` and `console.groupEnd` #16251
Conversation
Made having a group label optional and followed Firefox implementation
highfive
commented
Apr 3, 2017
|
Heads up! This PR modifies the following files: |
highfive
commented
Apr 3, 2017
|
Why'd you revert the commit? |
|
@jdm GitKraken glitch sorry about that.. |
|
One change should avoid a bunch of the redundant DOMString::new() additions. |
| } | ||
|
|
||
| fn prepare_message(log_level: LogLevel, message: DOMString) -> ConsoleMessage { | ||
| fn prepare_message(log_level: LogLevel, message: DOMString, group_name: DOMString) -> ConsoleMessage { |
This comment has been minimized.
This comment has been minimized.
jdm
Apr 5, 2017
Member
Given that only Group passes a real value for this, and it's a copy of the message, why not remove the extra argument and infer the groupName value based on the log level?
This comment has been minimized.
This comment has been minimized.
HarryLovesCode
Apr 6, 2017
Author
Contributor
Are you suggesting removing the argument from prepare_message and, since we are sending the label as the message, using that instead of the extra argument?
This comment has been minimized.
This comment has been minimized.
|
As for tests, we do not have any automated way of testing our devtools integration, unfortunately. I'm not sure what "needs logging" means. |
|
@jdm Side question, any reason Servo's WebIDL's are statically typed? // Servo
void log(DOMString... messages);
void info(DOMString... messages);
// Firefox
void log(any... data);
void info(any... data); |
|
Probably because that was the easiest way to get some kind of usable string value that we could print to the terminal. Firefox does more complicated formatting than toString(), so it makes sense to take an actual object. Why doesn't this PR complete #9274? It looks like it's ready to merge if you squash the two commits into one. |
|
Ooh, good point. |
|
|
|
Closing due to inactivity. |
HarryLovesCode commentedApr 3, 2017
•
edited
Group,GroupCollapsed,GroupEndfunctionsGroup,GroupCollapsed, andGroupEndNotes
console.groupCollapsedimplementationNightly Edition without Group Labels
Developer Edition without Group Labels
Nightly Edition with Group Labels
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is