Last active
September 29, 2022 02:18
-
-
Save jimkeller/a821f5385e03605913118cb4b825c963 to your computer and use it in GitHub Desktop.
NPM debug module in browser
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 DebugModule from "debug"; | |
//create a debug logger for my-component inside my-app | |
const debug = DebugModule("my-app:my-component"); | |
//enable the my-app namespace for debugging | |
DebugModule.enable("my-app:*"); | |
debug("This message will print now since my-app:* namespace is enabled for debugging"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment