Created
May 27, 2021 13:15
-
-
Save thompsonemerson/69ff089e8e6bc4a4ea9947274e5d8d66 to your computer and use it in GitHub Desktop.
pretty.log
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 pretty = { | |
| log: (label, value, type = '') => { | |
| console.log('%c⚡ ' + label, 'background-color: #9b59b6; border-left: 5px solid #8e44ad; padding: 2px 8px'); | |
| switch (type) { | |
| case 'warn': | |
| console.warn(value); | |
| break; | |
| case 'table': | |
| console.table(value); | |
| break; | |
| default: | |
| console.log(value); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment