33const Scm = require ( 'screwdriver-scm-base' ) ;
44const async = require ( 'async' ) ;
55const hoek = require ( 'hoek' ) ;
6- const winston = require ( 'winston ' ) ;
6+ const logger = require ( 'screwdriver-logger ' ) ;
77
88class 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 }
0 commit comments