Remove duplicate Logger in headless/index.js
Summary: init() was being misused. This returns a Logger instance, so there's no need to create one as well. This was a problem because different arguments were being passed to each (isHeadless in this case). Reviewed By: passy Differential Revision: D14083320 fbshipit-source-id: b0001a2b3cdd914609d54382575e3b0fa4b5f077
This commit is contained in:
committed by
Facebook Github Bot
parent
b9db2411cf
commit
8ff4c4f56d
@@ -8,7 +8,7 @@
|
|||||||
import {createStore} from 'redux';
|
import {createStore} from 'redux';
|
||||||
import reducers from '../src/reducers/index.js';
|
import reducers from '../src/reducers/index.js';
|
||||||
import dispatcher from '../src/dispatcher/index.js';
|
import dispatcher from '../src/dispatcher/index.js';
|
||||||
import Logger, {init} from '../src/fb-stubs/Logger.js';
|
import {init as initLogger} from '../src/fb-stubs/Logger.js';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
// $FlowFixMe this file exist, trust me, flow!
|
// $FlowFixMe this file exist, trust me, flow!
|
||||||
import setup from '../static/setup.js';
|
import setup from '../static/setup.js';
|
||||||
@@ -94,8 +94,7 @@ function startFlipper({
|
|||||||
devToolsEnhancer({realtime: true, hostname: 'localhost', port: 8181}),
|
devToolsEnhancer({realtime: true, hostname: 'localhost', port: 8181}),
|
||||||
)
|
)
|
||||||
: createStore(reducers);
|
: createStore(reducers);
|
||||||
const logger = new Logger(store, {isHeadless: true});
|
const logger = initLogger(store, {isHeadless: true});
|
||||||
init(store);
|
|
||||||
dispatcher(store, logger);
|
dispatcher(store, logger);
|
||||||
|
|
||||||
process.on('SIGINT', () => {
|
process.on('SIGINT', () => {
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export default class LogManager {
|
|||||||
debug(data: any, category: string) {}
|
debug(data: any, category: string) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function init(store: Store): LogManager {
|
export function init(store: Store, args?: Args): LogManager {
|
||||||
if (instance) {
|
if (instance) {
|
||||||
throw new Error('Attempted to initialize Logger when already initialized');
|
throw new Error('Attempted to initialize Logger when already initialized');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user