Skip to content

Commit

Permalink
Simplify/fix debug logic in metrics (related to #574)
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Jan 11, 2020
1 parent f818699 commit 8cc81f1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/metrics.js
Expand Up @@ -5,7 +5,6 @@ const windowSize = require('window-size');
const uuid = require('uuid');
const osName = require('os-name');
const isCi = require('is-ci');
const _ = require('lodash');
const debug = require('debug')('release-it:metrics');
const pkg = require('../package.json');

Expand Down Expand Up @@ -47,9 +46,6 @@ class Metrics {
this.isEnabled = isEnabled;
this.request = request;
}
debug(response) {
debug(_.pick(response, ['statusCode', 'statusMessage', 'url']));
}
send(payload) {
return !this.isEnabled
? noop
Expand All @@ -58,7 +54,9 @@ class Metrics {
retries: 0,
form: true,
body: payload
}).then(this.debug, this.debug);
})
.then(debug)
.catch(debug);
}
trackEvent(action, config) {
return this.send(
Expand Down

0 comments on commit 8cc81f1

Please sign in to comment.