Skip to content

Returns a visionmedia/debug instance with the namespace set to a prefixed application name. The path to the javascript file gets relatively namespaced based on the absolute path and the given namespace in the actual node module

License

Notifications You must be signed in to change notification settings

fortytwoio/getdebug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

getdebug

NPM version

Returns a visionmedia/debug instance with the namespace set to a prefixed application name. The path to the javascript file gets relatively namespaced based on the absolute path and the given namespace in the actual node module

Installation

$ npm install getdebug

Usage

// myapp/index.js
var getDebug = require("getdebug")(process.env.APP_NAME, __dirname);

// e.g. set with express as a "global" setting
app.set("getdebug", getDebug);


// in myapp/lib/controllers/foo.js
var getDebug = app.get("getdebug");
var debug = getDebug(__filename)

debug("Hello from here");

This is what you will see:

$ APP_NAME=example DEBUG=example* node myapp/index.js
example(27720):lib:controllers:foo Hello from here +1ms

License

MIT

About

Returns a visionmedia/debug instance with the namespace set to a prefixed application name. The path to the javascript file gets relatively namespaced based on the absolute path and the given namespace in the actual node module

Resources

License

Stars

Watchers

Forks

Packages

No packages published