admin管理员组文章数量:1387328
Every time I open a React Native app with Expo, I get this massive message in the console with meta data about the app, that doesn't actually do much to help me debug. Especially because it's the same info every time, and it shows up every time the app reloads (even with hot or live reloading):
Running application "main"
with appParams: {
"rootTag": 171,
"initialProps": {
"exp": {
"manifest": {
"splash": {
"backgroundColor": "#1c2d3c"
},
"packagerOpts": {
"lanType": "ip",
"urlRandomness": "e4-nfi",
"hostType": "tunnel",
"dev": true,
"minify": false
},
"debuggerHost": "localhost:19001",
"bundleUrl": "http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false&assetPlugin=pathToProjectFiles",
"facebookAppId": "FBAppIdGoesHere",
"android": {
"splash": {
"xxhdpi": "./src/assets/img/splash-android.png",
"backgroundColor": "#1c2d3c",
"xxxhdpiUrl": "http://localhost:19001/assets/./src/assets/img/splash-android.png",
"xhdpi": "./src/assets/img/splash-android.png",
"hdpi": "./src/assets/img/splash-android.png",
"xxxhdpi": "./src/assets/img/splash-android.png",
"resizeMode": "cover",
"ldpi": "./src/assets/img/splash-android.png",
"xxhdpiUrl": "http://localhost:19001/assets/./src/assets/img/splash-android.png",
"ldpiUrl": "http://localhost:19001/assets/./src/assets/img/splash-android.png",
"xhdpiUrl": "http://localhost:19001/assets/./src/assets/img/splash-android.png",
"hdpiUrl": "http://localhost:19001/assets/./src/assets/img/splash-android.png",
"mdpi": "./src/assets/img/splash-android.png",
"mdpiUrl": "http://localhost:19001/assets/./src/assets/img/splash-android.png"
},
"config": {
"googleSignIn": {
"apiKey": "APIKeyGoesHere",
"certificateHash": "HashGoesHere"
}
},
"iconUrl": "http://localhost:19001/assets/./src/assets/img/icon-android.png",
"package": "anizationName.apps",
"permissions": ["CAMERA", "INTERNET", "LOCATION", "READ_EXTERNAL_STORAGE", "READ_INTERNAL_STORAGE", "WRITE_EXTERNAL_STORAGE", ".anddoes.launcher.permission.UPDATE_COUNT", ".android.launcher.permission.INSTALL_SHORTCUT", ".google.android.c2dm.permission.RECEIVE", ".google.android.gms.permission.ACTIVITY_RECOGNITION", ".google.android.providers.gsf.permission.READ_GSERVICES", ".htc.launcher.permission.READ_SETTINGS", ".htc.launcher.permission.UPDATE_SHORTCUT", ".majeur.launcher.permission.UPDATE_BADGE", ".sec.android.provider.badge.permission.READ", ".sec.android.provider.badge.permission.WRITE", ".sonyericsson.home.permission.BROADCAST_BADGE"],
"icon": "./src/assets/img/icon-android.png",
"versionCode": 10
},
"slug": "app-name-goes-here",
"facebookDisplayName": "NameOfApp",
"icon": "./src/assets/img/icon-android.png",
"primaryColor": "#cccccc",
"isVerified": true,
"version": "1.1.5",
"xde": true,
"name": "NameOfApp",
"facebookScheme": "SomeFBSchemeCodeGoesHere",
"iconUrl": "http://localhost:19001/assets/./src/assets/img/icon-android.png",
"id": "@jhwheeler/name-of-app",
"hostUri": "localhost:19000",
"orientation": "portrait",
"sdkVersion": "27.0.0",
"env": {},
"hooks": {
"postPublish": [{
"config": {
"organization": "organizationNameHere",
"project": "projectNameHere",
"authToken": "authTokenGoesHere"
},
"file": "sentry-expo/upload-sourcemaps"
}]
},
"loadedFromCache": false,
"ios": {
"splash": {
"resizeMode": "cover",
"imageUrl": "http://localhost:19001/assets/./src/assets/img/splash-ios.png",
"backgroundColor": "#1c2d3c",
"image": "./src/assets/img/splash-ios.png"
},
"supportsTablet": false,
"iconUrl": "http://localhost:19001/assets/./src/assets/img/icon-ios.png",
"infoPlist": {
"NSLocationAlwaysUsageDescription": "Nice message goes here",
"NSLocationWhenInUseUsageDescription": "Nice message goes here"
},
"bundleIdentifier": "Name.apps",
"buildNumber": "1",
"icon": "./src/assets/img/icon-ios.png"
},
"logUrl": "http://localhost:19000/logs",
"privacy": "unlisted",
"mainModuleName": "node_modules/expo/AppEntry",
"developer": {
"projectRoot": "/path/to/project",
"tool": "xde"
},
"description": "descriptionOfApp"
},
"appOwnership": "expo",
"initialUri": "exp://localhost:19000",
"shell": 0
}
}
}.__DEV__ === true, development - level warning are ON, performance optimizations are OFF
If I'm looking at the Expo console, it is prefaced with BugReporting extraData:
and wraps the above in a JS object. I don't know if this is unique to Expo or a React Native message, but either way:
Is there any way to get rid of this message? It's so large that it makes finding actual errors much more laborious.
Every time I open a React Native app with Expo, I get this massive message in the console with meta data about the app, that doesn't actually do much to help me debug. Especially because it's the same info every time, and it shows up every time the app reloads (even with hot or live reloading):
Running application "main"
with appParams: {
"rootTag": 171,
"initialProps": {
"exp": {
"manifest": {
"splash": {
"backgroundColor": "#1c2d3c"
},
"packagerOpts": {
"lanType": "ip",
"urlRandomness": "e4-nfi",
"hostType": "tunnel",
"dev": true,
"minify": false
},
"debuggerHost": "localhost:19001",
"bundleUrl": "http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false&assetPlugin=pathToProjectFiles",
"facebookAppId": "FBAppIdGoesHere",
"android": {
"splash": {
"xxhdpi": "./src/assets/img/splash-android.png",
"backgroundColor": "#1c2d3c",
"xxxhdpiUrl": "http://localhost:19001/assets/./src/assets/img/splash-android.png",
"xhdpi": "./src/assets/img/splash-android.png",
"hdpi": "./src/assets/img/splash-android.png",
"xxxhdpi": "./src/assets/img/splash-android.png",
"resizeMode": "cover",
"ldpi": "./src/assets/img/splash-android.png",
"xxhdpiUrl": "http://localhost:19001/assets/./src/assets/img/splash-android.png",
"ldpiUrl": "http://localhost:19001/assets/./src/assets/img/splash-android.png",
"xhdpiUrl": "http://localhost:19001/assets/./src/assets/img/splash-android.png",
"hdpiUrl": "http://localhost:19001/assets/./src/assets/img/splash-android.png",
"mdpi": "./src/assets/img/splash-android.png",
"mdpiUrl": "http://localhost:19001/assets/./src/assets/img/splash-android.png"
},
"config": {
"googleSignIn": {
"apiKey": "APIKeyGoesHere",
"certificateHash": "HashGoesHere"
}
},
"iconUrl": "http://localhost:19001/assets/./src/assets/img/icon-android.png",
"package": "anizationName.apps",
"permissions": ["CAMERA", "INTERNET", "LOCATION", "READ_EXTERNAL_STORAGE", "READ_INTERNAL_STORAGE", "WRITE_EXTERNAL_STORAGE", ".anddoes.launcher.permission.UPDATE_COUNT", ".android.launcher.permission.INSTALL_SHORTCUT", ".google.android.c2dm.permission.RECEIVE", ".google.android.gms.permission.ACTIVITY_RECOGNITION", ".google.android.providers.gsf.permission.READ_GSERVICES", ".htc.launcher.permission.READ_SETTINGS", ".htc.launcher.permission.UPDATE_SHORTCUT", ".majeur.launcher.permission.UPDATE_BADGE", ".sec.android.provider.badge.permission.READ", ".sec.android.provider.badge.permission.WRITE", ".sonyericsson.home.permission.BROADCAST_BADGE"],
"icon": "./src/assets/img/icon-android.png",
"versionCode": 10
},
"slug": "app-name-goes-here",
"facebookDisplayName": "NameOfApp",
"icon": "./src/assets/img/icon-android.png",
"primaryColor": "#cccccc",
"isVerified": true,
"version": "1.1.5",
"xde": true,
"name": "NameOfApp",
"facebookScheme": "SomeFBSchemeCodeGoesHere",
"iconUrl": "http://localhost:19001/assets/./src/assets/img/icon-android.png",
"id": "@jhwheeler/name-of-app",
"hostUri": "localhost:19000",
"orientation": "portrait",
"sdkVersion": "27.0.0",
"env": {},
"hooks": {
"postPublish": [{
"config": {
"organization": "organizationNameHere",
"project": "projectNameHere",
"authToken": "authTokenGoesHere"
},
"file": "sentry-expo/upload-sourcemaps"
}]
},
"loadedFromCache": false,
"ios": {
"splash": {
"resizeMode": "cover",
"imageUrl": "http://localhost:19001/assets/./src/assets/img/splash-ios.png",
"backgroundColor": "#1c2d3c",
"image": "./src/assets/img/splash-ios.png"
},
"supportsTablet": false,
"iconUrl": "http://localhost:19001/assets/./src/assets/img/icon-ios.png",
"infoPlist": {
"NSLocationAlwaysUsageDescription": "Nice message goes here",
"NSLocationWhenInUseUsageDescription": "Nice message goes here"
},
"bundleIdentifier": "Name.apps",
"buildNumber": "1",
"icon": "./src/assets/img/icon-ios.png"
},
"logUrl": "http://localhost:19000/logs",
"privacy": "unlisted",
"mainModuleName": "node_modules/expo/AppEntry",
"developer": {
"projectRoot": "/path/to/project",
"tool": "xde"
},
"description": "descriptionOfApp"
},
"appOwnership": "expo",
"initialUri": "exp://localhost:19000",
"shell": 0
}
}
}.__DEV__ === true, development - level warning are ON, performance optimizations are OFF
If I'm looking at the Expo console, it is prefaced with BugReporting extraData:
and wraps the above in a JS object. I don't know if this is unique to Expo or a React Native message, but either way:
Is there any way to get rid of this message? It's so large that it makes finding actual errors much more laborious.
Share Improve this question asked Jul 26, 2018 at 13:46 Jackson Holiday WheelerJackson Holiday Wheeler 77112 silver badges26 bronze badges 2- 1 did you found any workaround on this one ? :p – Greco Jonathan Commented May 24, 2019 at 8:33
- Unfortunately, no! I suppose it would be possible to write a script to hide this, but I haven’t taken the time. And Expo have not provided any answer on their forums. – Jackson Holiday Wheeler Commented May 25, 2019 at 10:46
2 Answers
Reset to default 2I solved a similar problem by adding to the project root:
const ignoreConsoleMessages = [
'Running "main" with'
]
const origLog = console.log
console.log = (...params) => (
typeof params[0] === 'string' &&
ignoreConsoleMessages.reduce((acc, i) => acc + ~params[0].indexOf(i), 0)
? null
: origLog(...params)
)
I'm not familiar with Expo, but I encountered this log message recently with a vanilla RN project. I was able to remove it by adding the following to my index file:
console.ignoredYellowBox = ['react-native BugReporting extraData:'];
本文标签:
版权声明:本文标题:javascript - Is it possible to hide the "BugReporting extraData" in React Native? (Using Expo) - Stack Overflo 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744495749a2609014.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论