Last active
May 4, 2021 07:20
-
-
Save daffodilistic/c9d6418c0c12d719686ac1b6cf2fb209 to your computer and use it in GitHub Desktop.
Override Chrome's console object with debug package
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
import debug from 'debug'; | |
// HOW TO USE THIS: | |
// 1) import console from './helpers/DebugHelper' | |
// 2) set localStorage key: "debug" to "hello-world:*" | |
export default class console { | |
static DEBUG_KEY = "hello-world"; | |
static log(args) { | |
const logger = debug(console.DEBUG_KEY + ":log"); | |
logger(args); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment