Created
June 22, 2017 22:39
-
-
Save fernandocanizo/045ddc31a03fd80947287f178742c798 to your computer and use it in GitHub Desktop.
Console logging with style (browser only)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const success = [ | |
'background: green', | |
'color: white', | |
'display: block', | |
'text-align: center' | |
].join(';'); | |
const failure = [ | |
'background: red', | |
'color: white', | |
'display: block', | |
'text-align: center' | |
].join(';'); | |
console.info('%c /dancing/bears was Successful!', success); | |
console.log({data: { | |
name: 'Bob', | |
age: 'unknown' | |
}}); // "mocked" data response | |
console.error('%c /dancing/bats failed!', failure); | |
console.log('/dancing/bats Does not exist'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment