[Webkit-unassigned] [Bug 101495] Web Inspector: styled logs should work with multiple log() arguments

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Nov 8 07:51:23 PST 2012


Jan Honza Odvarko <odvarko at gmail.com> changed:

           What    |Removed                     |Added
                 CC|                            |odvarko at gmail.com

--- Comment #2 from Jan Honza Odvarko <odvarko at gmail.com>  2012-11-08 07:52:58 PST ---
(In reply to comment #1)
> > I would expect these to work:
> > 
> > console.log('%c red text', 'unstyled', 'color:red');
> > console.log(window, 'unstyled', '%c red text', 'color:red');
> > console.log('unstyled', document.body, '%c red text', 'color:red');

> Here is the message formatting logic: when there are multiple arguments, if
> the first argument is a string, it is considered a "message format". message
> format string absorbes parameter per %X occurrence.

FWG had a similar discussion about styling parts of the log output, e.g. make only part of the log red or green.

What about using the following concept:

console.log('%c red-text %c green-text', 'color:red', 'color:green');


Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list