Skip to content

Commit b71ecd3

Browse files
committed
fix: use screwdriver-logger
1 parent 28393f5 commit b71ecd3

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const Scm = require('screwdriver-scm-base');
44
const async = require('async');
55
const hoek = require('hoek');
6-
const winston = require('winston');
6+
const logger = require('screwdriver-logger');
77

88
class ScmRouter extends Scm {
99
/**
@@ -52,7 +52,7 @@ class ScmRouter extends Scm {
5252
*/
5353
loadPlugin(plugin, options) {
5454
if (plugin === 'router') {
55-
console.warn('The plugin of scm-router can not be specified for scms setting');
55+
logger.warn('The plugin of scm-router can not be specified for scms setting');
5656

5757
return;
5858
}
@@ -63,7 +63,7 @@ class ScmRouter extends Scm {
6363
// eslint-disable-next-line global-require, import/no-dynamic-require
6464
ScmPlugin = require(`screwdriver-scm-${plugin}`);
6565
} catch (e) {
66-
console.warn(`Scm plugin ${plugin} is not supported`);
66+
logger.warn(`Scm plugin ${plugin} is not supported`);
6767

6868
return;
6969
}
@@ -73,13 +73,13 @@ class ScmRouter extends Scm {
7373
const scmContext = scmContexts[0]; // plugins return only one scmContext
7474

7575
if (!scmContext || typeof scmContext !== 'string') {
76-
console.warn(`Illegal scmContext for ${plugin} scm plugin`);
76+
logger.warn(`Illegal scmContext for ${plugin} scm plugin`);
7777

7878
return;
7979
}
8080

8181
if (typeof this.scms[scmContext] === 'object') {
82-
console.warn(`Duplicate scm config for ${scmContext}`);
82+
logger.warn(`Duplicate scm config for ${scmContext}`);
8383

8484
return;
8585
}
@@ -175,7 +175,7 @@ class ScmRouter extends Scm {
175175
return this.chooseWebhookScm(headers, payload)
176176
.then((scm) => {
177177
if (!scm) {
178-
winston.info('Webhook does not match any expected events or actions.');
178+
logger.info('Webhook does not match any expected events or actions.');
179179

180180
return null;
181181
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@
3737
"eslint": "^4.19.1",
3838
"eslint-config-screwdriver": "^3.0.1",
3939
"hoek": "^5.0.4",
40-
"jenkins-mocha": "^6.0.0",
40+
"jenkins-mocha": "^8.0.0",
4141
"mockery": "^2.0.0",
4242
"sinon": "^2.3.4"
4343
},
4444
"dependencies": {
4545
"async": "^2.6.1",
4646
"screwdriver-scm-base": "^5.0.0",
47-
"winston": "^3.1.0"
47+
"screwdriver-logger": "^1.0.0"
4848
},
4949
"release": {
5050
"debug": false,

0 commit comments

Comments
 (0)