I know how to change the color of the first line.
console.log ( '%c%s', 'color:' + color, str )
But my string looks like this.
console.log('%c'+ args[args.length-1], 'color:' + color,performance['now'](true, args[args.length-1]),'[(', ...args.slice(0, args.length-1),'*)',`${message}`,']')
How can I change my console.log so that the message '~~~~~~~~~ example ~~~~~~~~~~' also changes color ?
Addition:
I don't understand...
All examples are of the form
console.log ( '%c%s', 'color:' + color, str )
I made one line of this kind and my color is preserved. But here is another problem.
console.log(`%c ${args[args.length-1]} ${performance['now'](true, args[args.length-1])} [(${args.slice(0, args.length-1)} *) ${message}]`, 'color:' + color)
result:
But how do I display objects in expanded form?
When trying to add a second color to the console, she does not see this.
console.log('%c'+ args[args.length-1], 'color:' + color,performance['now'](true, args[args.length-1]),'[(', ...args.slice(0, args.length-1),'*)',`%c` +`${message}`,']','color:' + color)
result:
Addition:
result your:
console.log('%c%O' + ' '+ args[args.length-1],'color:' + color,performance['now'](end, args[args.length-1], message),'[(', ...args.slice(0, args.length-1),'*)',message,']')
result what i use: