
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
captains-log
Advanced tools
Simple wrapper around Winston to allow for declarative configuration
Based on npm's log levels
log.silly()
log.verbose()
log.info()
log.debug()
log.http()
, but we call it debug
. If you use log()
, the logger sees this as a call to log.debug()
)log.warn()
log.error()
/**
* Using Winston
* ====================================
*
* Formerly, this module encapsulated Winston, a popular logger
* by @indexzero and the gals/guys over at Nodejitsu.
* Recently, we made Winston optional to make CaptainsLog as
* lightweight as possible and reduce `npm install`/`require()`
* for its usage in other modules.
*
* But Winston is awesome! And it's a great fit for many apps,
* giving you granular control over how log output is handled,
* including sending emails, logging to multiple transports,
* and other production-time concerns.
*
* More info/docs on Winston:
* https://github.com/flatiron/winston
*
* To use Winston w/ captains-log, do the following:
var captains = CaptainsLog({
custom: new (require('winston').Logger)({
levels : ...,
transports : ...
})
});
*
*/
/**
*
* Using your own custom logger
* ====================================
*
* To use a different library, `overrides.custom` must already
* be instantiated and ready to go with (at minimum) an n-ary `.debug()`
* method. i.e. by n-ary, I mean that the following should
* work (with any # of arguments):
customLogger.debug()
customLogger.debug('blah')
customLogger.debug('blah', 'foo')
customLogger.debug('blah', 'foo', {bar: 'baz'})
customLogger.debug('blah', 'foo', {bar: 'baz'}, ['a', 3], 2, false);
// etc.
// To use a custom logged
var captains = CaptainsLog({
custom: customLogger
});
*
*/
FAQs
Lightweight logger with a simple pass-through configuration for use with fancier logging libraries
The npm package captains-log receives a total of 46,004 weekly downloads. As such, captains-log popularity was classified as popular.
We found that captains-log demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.