Introduce useLogger hook

Summary: In the Flipper chrome there is a lot of `logger={logger}` prop drilling. Let's not do that anymore in the future by using a proper hook, which is exposed from `flipper-plugin`.

Reviewed By: passy

Differential Revision: D25421304

fbshipit-source-id: 01ec8563c67f7e2fac359c2f8216eba722bff8d9
This commit is contained in:
Michel Weststrate
2020-12-09 05:31:13 -08:00
committed by Facebook GitHub Bot
parent 083dbd3dbc
commit 4aff8c1bcf
7 changed files with 130 additions and 43 deletions

View File

@@ -62,6 +62,13 @@ export {
} from './ui/Tracked';
export {sleep} from './utils/sleep';
export {
LogTypes,
TrackType,
Logger,
useLogger,
_LoggerContext,
} from './utils/Logger';
// It's not ideal that this exists in flipper-plugin sources directly,
// but is the least pain for plugin authors.