mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-02-21 07:29:37 +01:00
Merge pull request #153 from verdaccio/issue-144
Increase verbose on notify request, helps #144
This commit is contained in:
commit
2ed6d7f750
@ -1,5 +1,6 @@
|
|||||||
var Handlebars = require('handlebars')
|
var Handlebars = require('handlebars')
|
||||||
var request = require('request')
|
var request = require('request')
|
||||||
|
var Logger = require('./logger')
|
||||||
|
|
||||||
module.exports.notify = function(metadata, config) {
|
module.exports.notify = function(metadata, config) {
|
||||||
|
|
||||||
@ -18,11 +19,20 @@ module.exports.notify = function(metadata, config) {
|
|||||||
|
|
||||||
options.method = config.notify.method;
|
options.method = config.notify.method;
|
||||||
|
|
||||||
if(config.notify.endpoint) {
|
if (config.notify.endpoint) {
|
||||||
options.url = config.notify.endpoint
|
options.url = config.notify.endpoint
|
||||||
}
|
}
|
||||||
|
|
||||||
request(options);
|
request(options, function(err, response, body) {
|
||||||
|
if (err) {
|
||||||
|
Logger.logger.error( { err: err }, ' notify error: @{err.message}' );
|
||||||
|
} else {
|
||||||
|
Logger.logger.info({ content: content}, 'A notification has been shipped: @{content}')
|
||||||
|
if (body) {
|
||||||
|
Logger.logger.debug( { body: body }, ' body: @{body}' );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user