DevTools: console messages using style formatter with line breaks looks strange |
||
Issue description
Evaluate this in the DevTools console:
console.log('foo%cbar\n\t', 'color:green')
,
Apr 7 2018
looks strange
console.log('%cfoo \n %cbar \n %cbaz \n', 'color: red', 'color:green', 'color: blue')
Expected:
foo
bar
baz
Actual (Chrome)
foo bar
baz
,
Apr 7 2018
Bug console.log( '%c A \n B \n C \n %c D \n E', 'background: #fff;color:red;' ); A B C D %c E
,
Apr 9 2018
Issue 830175 has been merged into this issue.
,
Apr 13 2018
Issue 832716 has been merged into this issue.
,
May 17 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/cf20524aad95b76a21447a354926a313f6e618f4 commit cf20524aad95b76a21447a354926a313f6e618f4 Author: Erik Luo <luoe@chromium.org> Date: Thu May 17 22:06:12 2018 DevTools: fix console style formatter regressions This CL addresses vertical alignment, horizontal overflow, and the creation of newlines in Console logs that use the style formatter. Very long fragments still break into their own block, due to the `contain: paint` rule. Screenshot: https://imgur.com/a/QiNbvIT Bug: 810581 Change-Id: Iefb5533d5696a7b91e3ff9863af67740a8e07225 Reviewed-on: https://chromium-review.googlesource.com/1058394 Reviewed-by: Dmitry Gozman <dgozman@chromium.org> Commit-Queue: Erik Luo <luoe@chromium.org> Cr-Commit-Position: refs/heads/master@{#559700} [modify] https://crrev.com/cf20524aad95b76a21447a354926a313f6e618f4/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-format-style-expected.txt [modify] https://crrev.com/cf20524aad95b76a21447a354926a313f6e618f4/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-format-style-whitelist-expected.txt [modify] https://crrev.com/cf20524aad95b76a21447a354926a313f6e618f4/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-format-style.js [modify] https://crrev.com/cf20524aad95b76a21447a354926a313f6e618f4/third_party/blink/renderer/devtools/front_end/console/ConsoleViewMessage.js
,
May 17 2018
,
May 24 2018
Will you merge the fix to 67?
,
May 24 2018
M67 is planned for stable release soon, and might be out by next week. There is not enough time to bake in canary and beta, so I do not plan to merge. The patch in #8 still targets M68.
,
May 24 2018
Issue 846364 has been merged into this issue.
,
Jul 9
|
||
►
Sign in to add a comment |
||
Comment 1 by gael.bou...@wiztivi.com
, Mar 23 2018Also this : console.log("foo%cbar Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", "color:green"); When the console isn't wide enough to fit the message on one line, it'll break after style tags. %c here