Show colorful messages in devtools console
Ever wondered how those portals (e.g. facebook) show colorful greeting and warning messages when you open devtools?
Look no further! ...
console_with_styling = function(e) {
return console.log(""),
console.log("%c" + e, ["background: #0205D3", "color: white", "display: block", "text-align: center", "font-weight: bold", "padding: 7px", "border-radius: 2px"].join(";")),
console.log("")
}
console_with_styling("Woo hoo!~")