Skip to content

Instantly share code, notes, and snippets.

@vdanchenkov
Last active September 25, 2016 00:04
Show Gist options
  • Save vdanchenkov/b9492d396b4ec144b47587c4ca808217 to your computer and use it in GitHub Desktop.
Save vdanchenkov/b9492d396b4ec144b47587c4ca808217 to your computer and use it in GitHub Desktop.
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