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:
Daniel Büchele
2018-08-14 03:01:22 -07:00
committed by Facebook Github Bot
parent eb316be4e4
commit 6f2a7dcb05
6 changed files with 37 additions and 14 deletions

View File

@@ -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,