UNPKG

1.03 kBJavaScriptView Raw
1import Constants from 'expo-constants';
2import * as Logs from '../logs/Logs';
3import RemoteLogging from '../logs/RemoteLogging';
4if (Constants.manifest && Constants.manifest.logUrl) {
5 // Enable logging to the Expo dev tools only if this JS is not running in a web browser (ex: the
6 // remote debugger). In Expo Web we don't show console logs in the CLI, so there's no special case needed.
7 if (!isRunningInWebBrowser()) {
8 Logs.enableExpoCliLogging();
9 }
10 else {
11 RemoteLogging.enqueueRemoteLogAsync('info', {}, [
12 'You are now debugging remotely; check your browser console for your application logs.',
13 ]);
14 }
15}
16/**
17 * In all web browsers navigator.product is "Gecko" for compatibility reasons.
18 * See https://developer.mozilla.org/en-US/docs/Web/API/NavigatorID/product
19 * and the discussion at https://github.com/expo/expo/pull/8807#discussion_r441391148.
20 */
21function isRunningInWebBrowser() {
22 return navigator?.product === 'Gecko';
23}
24//# sourceMappingURL=logging.fx.js.map
\No newline at end of file