Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
colorful, nice formatted logs for node.js
ATTENTION: this library should only be used when developing - it makes use of the sysnchronous logging funtionality ( like console.log itself ). you should never use synchronous logging in a live environment, it will slow down your application heavily! The library will be updated soon with asynchronous logging support for live applicaions.
npm install ee-log
var log = require( "ee-log" );
prints grey text
log.debug( "debug %s ==> %s", 1, new Buffer( "whoa!" ), { go: "is a cool language!"} );
// output:
22 13:06:34.935 > test.js:6, Object.<anonymous> >>> debug 1 ==> 77 68 6f 61 21
{
go: "is a cool language!"
}
prints white text
log.info( "info" );
// output
22 13:06:34.939 > test.js:7, Object.<anonymous> >>> info
prints yellow text
log.warn( "warn", new Date(), 455 );
// output
22 13:06:34.940 > test.js:8, Object.<anonymous> >>> warn, 2013-08-22T11:06:34.939Z, 455
prints red text
log.error( "error", { "test": 3 } );
// output
22 13:06:34.940 > test.js:9, Object.<anonymous> >>> error
prints cyan text
log.highlight( "highlight" );
// output
22 13:06:34.940 > test.js:10, Object.<anonymous> >>> highlight
prints the items passed to it
log.dir( { hi: 1 } );
// output
22 13:16:32.207 > test.js:11, Object.<anonymous> >>> Dir
{
hi: 1
}
prints a colorful error stack trace
log.trace( new Error( "testing the sh*t" ) );
// output
22 13:30:48.899 > /test.js:12, Object.<anonymous> >>> Trace
--------------------------------------------------------------------------------
Error: testing the sh*t
--------------------------------------------------------------------------------
/test.js 12:13 Object.<anonymous>
module.js 456:26 Module._compile
module.js 474:10 Object.Module._extensions..js
module.js 356:32 Module.load
module.js 312:12 Function.Module._load
module.js 497:10 Function.Module.runMain
node.js 119:16 startup
node.js 901:3
--------------------------------------------------------------------------------
prints whatever comes, uses log.info for text types
log( 2, "er %s:%s", 22, new Error( "whoa!" ), "hui", new Error( "" ), new Buffer(22) );
// output
23 14:53:15.480 > /test.js 16:2, Object.<anonymous> >>> 2
23 14:53:15.480 > /test.js 16:2, Object.<anonymous> >>> er 22:Error: whoa!
23 14:53:15.480 > /test.js 16:2, Object.<anonymous> >>> hui
23 14:53:15.482 > /test.js 16:2, Object.<anonymous> >>> [Trace]
--------------------------------------------------------------------------------
Error: -
--------------------------------------------------------------------------------
/test.js 16:55 Object.<anonymous>
module.js 456:26 Module._compile
module.js 474:10 Object.Module._extensions..js
module.js 356:32 Module.load
module.js 312:12 Function.Module._load
module.js 497:10 Function.Module.runMain
node.js 119:16 startup
node.js 901:3
--------------------------------------------------------------------------------
23 14:53:15.482 > /test.js 16:2, Object.<anonymous> >>> 70 ab ac 0 0 0 0 0 3a 0 0 0 3b 0 0 0 f0 34 72 1 0 0
// call this from inside your module, no logs will be displayed anymore
log.disable();
// enable logging again
log.enable();
FAQs
Easy, simple & beautiful logs
The npm package ee-log receives a total of 6,434 weekly downloads. As such, ee-log popularity was classified as popular.
We found that ee-log 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
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.