diff --git a/bin/macaca-client-run b/bin/macaca-client-run index fc56380..532b585 100755 --- a/bin/macaca-client-run +++ b/bin/macaca-client-run @@ -88,7 +88,10 @@ runner.on('data', function(data) { if (chunks) { chunks.push(format(data, 'html')); } - logger.info(format(data, 'tty')); + var log = format(data, 'tty'); + if (log !== 'null') { + logger.info(log); + } }); runner.on('error', function(err) { diff --git a/lib/common/logFormatter/index.js b/lib/common/logFormatter/index.js index 564facb..fc57458 100644 --- a/lib/common/logFormatter/index.js +++ b/lib/common/logFormatter/index.js @@ -13,6 +13,7 @@ 'use strict'; +var logger = require('../logger'); var screenshot = require('./screenshot'); var performance = require('./performance'); @@ -30,7 +31,8 @@ function handler(type, log, contentType) { if (contentType === 'html') { return screenshot(log); } else if (contentType === 'tty') { - return log; + logger.debug(log); + return null; } break; case 'performance': @@ -49,7 +51,7 @@ function format(logs, contentType) { var log = arr[1]; if (type && log) { var res = handler(type, log, contentType); - if (res) { + if (res !== '') { return res; } } diff --git a/package.json b/package.json index 9f7b1fb..4a51d1d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "macaca-client", - "version": "1.0.19", + "version": "1.0.20", "description": "Macaca automation client", "keywords": [ "automation",