qualitybath / bunyan-slack Goto Github PK
View Code? Open in Web Editor NEWBunyan stream for Slack chat integration
Bunyan stream for Slack chat integration
I'd like to see an example of the integration before attempting to use it, just to see an example of it.
Hi, I'm wondering if anyone is maintaining this package? It is used in various projects we work on and now is reporting some npm audit errors. We have created a fork of this package to get around this temporarily, would you still accept pull requests to it? alternatively we would be happy to maintain it ourselves if you would prefer to transfer ownership?
slack will disable the integration if it starts sending too many errors too quickly
see: https://api.slack.com/docs/rate-limits
we should probably add an option to which allows you to specify the max messages/time and it should auto rate limit once that limit is reached.
Is it possible to set the log level for the stream rather than globally on the logger? It would be nice to set slack to error but main logs stream to info.
I see you have a test to make sure your error handler is being run. I can't run your tests on my machine as I receive the following error, but your travis-ci build suggests that the test passes.
In the following code block, in .on('error') you are returning this.error
, but this
will have lost its context when the error event fires, so you should really take a reference to this
outside the request call, for example var self = this
, then reference return self.error(error)
. I believe your code will fail otherwise!
request.post({
url: this.webhook_url,
body: JSON.stringify(message)
})
.on('error', function(err) {
return this.error(err);
});
My attempt at running your tests - maybe a mocha issue?
$ npm test
> [email protected] test C:\repositories\bunyan-slack
> istanbul cover _mocha --report lcovonly
No coverage information was collected, exit without writing coverage information
C:\repositories\bunyan-slack\node_modules\.bin\_mocha.CMD:1
(function (exports, require, module, __filename, __dirname) { @IF EXIST "%~dp0
^
SyntaxError: Unexpected token ILLEGAL
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:414:25)
at Object.Module._extensions..js (module.js:449:10)
at Object.Module._extensions.(anonymous function) [as .js] (C:\repositories\bunyan-slack\node_modules\istanbul\lib\hook.js:107:37)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:472:10)
at runFn (C:\repositories\bunyan-slack\node_modules\istanbul\lib\command\common\run-with-cover.js:122:16)
at C:\repositories\bunyan-slack\node_modules\istanbul\lib\command\common\run-with-cover.js:248:17
at C:\repositories\bunyan-slack\node_modules\istanbul\lib\util\file-matcher.js:68:16
npm ERR! Test failed. See above for more details.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.