[ReactNative] Dim packager output

This commit is contained in:
Alex Kotliarskyi
2015-04-17 17:01:18 -07:00
parent ab1efbd4c1
commit f3e7511d2b
3 changed files with 23 additions and 17 deletions

View File

@@ -0,0 +1,13 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
'use strict';
module.exports = {
dim: function(s) { return s; },
};

View File

@@ -8,6 +8,8 @@
*/
'use strict';
var chalk = require('chalk');
var COLLECTION_PERIOD = 1000;
var _endedEvents = Object.create(null);
@@ -132,22 +134,22 @@ function _writeAction(action) {
switch (action.action) {
case 'startEvent':
console.log(
console.log(chalk.dim(
'[' + fmtTime + '] ' +
'<START> ' + action.eventName +
data
);
));
break;
case 'endEvent':
var startAction = _eventStarts[action.eventId];
var startData = startAction.data ? ': ' + JSON.stringify(startAction.data) : '';
console.log(
console.log(chalk.dim(
'[' + fmtTime + '] ' +
'<END> ' + startAction.eventName +
'(' + (action.tstamp - startAction.tstamp) + 'ms)' +
' (' + (action.tstamp - startAction.tstamp) + 'ms)' +
startData
);
));
delete _eventStarts[action.eventId];
break;