Skip to content

Commit

Permalink
Merge pull request #30 from macacajs/log
Browse files Browse the repository at this point in the history
Move screenshot log to debug level
  • Loading branch information
ziczhu committed Apr 26, 2016
2 parents b912b14 + 059bc25 commit d54aa58
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion bin/macaca-client-run
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 4 additions & 2 deletions lib/common/logFormatter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

'use strict';

var logger = require('../logger');
var screenshot = require('./screenshot');
var performance = require('./performance');

Expand All @@ -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':
Expand All @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "macaca-client",
"version": "1.0.19",
"version": "1.0.20",
"description": "Macaca automation client",
"keywords": [
"automation",
Expand Down

0 comments on commit d54aa58

Please sign in to comment.