Extract logger and write to file

Summary:
This change extracts logging logic out from startFlipperServer.

Logs will also be written to disk.

Reviewed By: passy

Differential Revision: D36473768

fbshipit-source-id: b1df9df79b4aced0d3ba2e8c243aa8d44cf83703
This commit is contained in:
Lorenzo Blasa
2022-06-01 02:37:03 -07:00
committed by Facebook GitHub Bot
parent 92cdb81096
commit ee64216725
3 changed files with 99 additions and 42 deletions

View File

@@ -14,6 +14,7 @@ import {startFlipperServer} from './startFlipperServer';
import {startServer} from './startServer';
import {attachSocketServer} from './attachSocketServer';
import {attachDevServer} from './attachDevServer';
import {initializeLogger} from './logger';
import yargs from 'yargs';
import open from 'open';
@@ -72,10 +73,7 @@ const rootDir = argv.bundler
const staticDir = path.join(rootDir, 'static');
async function start() {
// supress debug messages by default. TODO: make CLI flag
console.debug = function () {
// Noop
};
initializeLogger(staticDir);
const {app, server, socket} = await startServer({
port: argv.port,