Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
debug-logger
Advanced tools
A thin wrapper for visionmedia's debug logger
visionmedia/debug is a ubitiquous logging library with 1000+ dependants. Given how widespread it is and the convenience of namespaces it is a great logger for library modules.
debug-logger
is a convenicence wrapper around debug
that adds level based coloured output. Each instance of debug-logger
contains 2 instances of debug
, one for general purpose logging and another using namespace:debug
for debug logs.
AppsCot uses debug-logger
in waterline-orientdb.
npm install debug-logger -S
var log = require('debug-logger')('myapp');
log.debug("I'm a debug output");
log.info("I'm an info output");
log.warn("I'm a warn output");
log.error("I'm an error output");
log.error('Something failed:', new Error('error message'));
More examples in the examples folder.
log.debug(message, [Error|Object])
log.info(message, [Error|Object])
log.warn(message, [Error|Object])
log.error(message, [Error|Object])
Prints the message prepended by log level. If the terminal supports colors, the level will be one of: blue, green, yellow, red. If an Error is provided, the toString() and call stack will be outputted. If an Object is provided the toString() and util.inspect() will be outputted. Example:
myapp:debug DEBUG I'm a debug output +0ms
myapp INFO I'm an info output +1ms
log.logger
Returns the default debug instance.
log.debugLogger
Returns the debug debug instance which was instanciated with "provided_namespace:debug".
log.isEnabled
Boolean indicating if default logger is enabled.
log.isDebugEnabled
Boolean indicating if debug logger is enabled.
FAQs
A wrapper for visionmedia/debug logger, adding levels and colored output
The npm package debug-logger receives a total of 4,036 weekly downloads. As such, debug-logger popularity was classified as popular.
We found that debug-logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.