clean up console
Summary: The console was pretty spammy. This fixes some issues that were logged and changes many log statements to `console.debug` which are not shown by default. Reviewed By: passy Differential Revision: D9303011 fbshipit-source-id: 1102f4f8814152a45f155cb43488a515c2d4eee4
This commit is contained in:
committed by
Facebook Github Bot
parent
eb316be4e4
commit
6f2a7dcb05
@@ -244,6 +244,9 @@ export default class LogTable extends SonarDevicePlugin<LogsState> {
|
||||
static icon = 'arrow-right';
|
||||
static keyboardActions = ['clear', 'goToBottom', 'createPaste'];
|
||||
|
||||
initTimer: ?TimeoutID;
|
||||
batchTimer: ?TimeoutID;
|
||||
|
||||
onKeyboardAction = (action: string) => {
|
||||
if (action === 'clear') {
|
||||
this.clearLogs();
|
||||
@@ -384,7 +387,7 @@ export default class LogTable extends SonarDevicePlugin<LogsState> {
|
||||
if (!queued) {
|
||||
queued = true;
|
||||
|
||||
setTimeout(() => {
|
||||
this.batchTimer = setTimeout(() => {
|
||||
const thisBatch = batch;
|
||||
batch = [];
|
||||
queued = false;
|
||||
@@ -421,13 +424,22 @@ export default class LogTable extends SonarDevicePlugin<LogsState> {
|
||||
}
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
this.initTimer = setTimeout(() => {
|
||||
this.setState({
|
||||
initialising: false,
|
||||
});
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
if (this.initTimer) {
|
||||
clearTimeout(this.initTimer);
|
||||
}
|
||||
if (this.batchTimer) {
|
||||
clearTimeout(this.batchTimer);
|
||||
}
|
||||
}
|
||||
|
||||
addRowIfNeeded(
|
||||
rows: Array<TableBodyRow>,
|
||||
row: TableBodyRow,
|
||||
|
||||
Reference in New Issue
Block a user