intel 0.4
I released v0.4 of intel last month, but never got around to writing up what’s new.
debug/dbug
I started out all this logging business claiming we should console.log() all the things. intel can easily handle any libaries using console.log
. However, I started to see how frustrating it could be for libraries to be spilling logs all over stdout without being asked. dbug is a utility for libraries to provide logging, but to be quiet by default.
intel v0.4 includes the ability to play nice with dbug (and debug). You can call intel.console({ debug: someStr })
to turn on dbug in libraries matching your string. Due to how debug works, by checking an environment variable right when it is required, you’ll need to run intel.console()
before requiring any library that uses debug.
performance
As with every release, things get faster. According to meaningless benchmarks, we’re now ~2x faster than winston. Whatever that means.
syslog
Not part of the actual release, but released at the same time, is an intel-syslog library. This provides a simple syslog handler that you can easily use in your app.
require('intel').config({
handlers: {
'syslog': {
'class': 'intel-syslog',
'address': '127.0.0.1',
'facility': 'user' //etc...
}
},
loggers: {
'myapp': {
'handlers': ['syslog']
}
}
});
I’ve created a wiki page to contain handlers such as intel-syslog that work with intel. If you create or find a library for intel, please add it to the list so we all can be happier logging things.