Skip to content

Instantly share code, notes, and snippets.

@jimkeller
Last active September 29, 2022 02:18
Show Gist options
  • Save jimkeller/a821f5385e03605913118cb4b825c963 to your computer and use it in GitHub Desktop.
Save jimkeller/a821f5385e03605913118cb4b825c963 to your computer and use it in GitHub Desktop.
NPM debug module in browser
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