Bring back transmitting server logs to the client

Reviewed By: lblasa

Differential Revision: D50263610

fbshipit-source-id: 652970f95ad50998c4c2f3f0e48cfce5a2d64cc1
This commit is contained in:
Andrey Goncharov
2023-10-16 05:44:07 -07:00
committed by Facebook GitHub Bot
parent fe7a839b14
commit 9ab0e84b1b

View File

@@ -29,7 +29,7 @@ import {
startServer,
tracker,
} from 'flipper-server-core';
import {isTest} from 'flipper-common';
import {addLogTailer, isTest, LoggerFormat} from 'flipper-common';
import exitHook from 'exit-hook';
import {getAuthToken} from 'flipper-server-core';
import {findInstallation} from './findInstallation';
@@ -216,6 +216,12 @@ async function start() {
// At this point, the HTTP server is ready and configuration is set.
await launch();
if (!isProduction) {
addLogTailer((level, ...data) => {
flipperServer.emit('server-log', LoggerFormat(level, ...data));
});
}
const t6 = performance.now();
const launchedMS = t6 - t5;