Created
January 7, 2018 10:46
-
-
Save dannycroft/d90cfb8514f82c89eb45571e3dbb47e6 to your computer and use it in GitHub Desktop.
Jazz hands for your console logs
This file contains hidden or 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 log = new Proxy({}, { | |
get: (_, color) => (...args) => { | |
console.log(`%c ${args.join(' ')}`, `color: ${color}`); | |
} | |
}); | |
// example | |
log.tomato('I am tomato'); | |
log.chocolate('I am chocolate'); | |
log.cornflowerblue('I am cornflowerblue'); | |
log.darkcyan('I am darkcyan'); | |
log.goldenrod('I am goldenrod'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment