diff --git a/bin/cml.js b/bin/cml.js index 6d72d6c80..983c1893f 100755 --- a/bin/cml.js +++ b/bin/cml.js @@ -20,6 +20,7 @@ const configureLogger = (level) => { ), transports: [ new winston.transports.Console({ + stderrLevels: Object.keys(winston.config.npm.levels), handleExceptions: true, handleRejections: true, level diff --git a/bin/cml/runner.js b/bin/cml/runner.js index 7ddc735a5..1361ca8fb 100755 --- a/bin/cml/runner.js +++ b/bin/cml/runner.js @@ -93,14 +93,13 @@ const shutdown = async (opts) => { } }; - if (error) winston.error(error); - console.log( - JSON.stringify({ - level: error ? 'error' : 'info', - status: 'terminated', - reason - }) - ); + if (error) { + winston.error(error, { reason, status: 'terminated' }); + } else { + winston.info('runner status', { reason, status: 'terminated' }); + } + + winston.info(`waiting ${RUNNER_DESTROY_DELAY} seconds before exiting...`); await sleep(RUNNER_DESTROY_DELAY); if (cloud) { @@ -229,7 +228,7 @@ const runLocal = async (opts) => { const dataHandler = async (data) => { const log = await cml.parseRunnerLog({ data }); - log && winston.info('runner log', log); + log && winston.info('runner status', log); if (log && log.status === 'job_started') { RUNNER_JOBS_RUNNING.push({ id: log.job, date: log.date }); diff --git a/src/drivers/github.js b/src/drivers/github.js index cf7dab260..0392466ca 100644 --- a/src/drivers/github.js +++ b/src/drivers/github.js @@ -48,7 +48,7 @@ const octokit = (token, repo) => { const throttleHandler = (retryAfter, options) => { if (options.request.retryCount <= 5) { - winston.log(`Retrying after ${retryAfter} seconds!`); + winston.info(`Retrying after ${retryAfter} seconds!`); return true; } };