mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-26 13:25:51 +08:00
[ReactNative] Dim packager output
This commit is contained in:
13
packager/react-packager/src/Activity/__mocks__/chalk.js
vendored
Normal file
13
packager/react-packager/src/Activity/__mocks__/chalk.js
vendored
Normal 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; },
|
||||
};
|
||||
12
packager/react-packager/src/Activity/index.js
vendored
12
packager/react-packager/src/Activity/index.js
vendored
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user