Last active
September 25, 2016 00:04
-
-
Save vdanchenkov/b9492d396b4ec144b47587c4ca808217 to your computer and use it in GitHub Desktop.
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
console.logg = (...args) => { | |
args.forEach(arg => { | |
if (arg !== null && typeof arg === 'object' && !Array.isArray(arg)) { | |
Object.keys(arg).forEach(propName => { | |
console.log(`\u001b[7m${propName}:\u001b[27m`) | |
console.log(arg[propName]) | |
}) | |
} else { | |
console.log(arg) | |
} | |
}) | |
} | |
/* | |
Use console.logg({foo}) instead of console.log('foo', foo) to get: | |
foo: | |
(Foo contents here) | |
console.logg({ foo, bar }) works too. | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment