Remove/Avoid console.log calls in release build
Opened this issue · 1 comments
emanuelb commented
There are several console.log
calls in the code below:
it's better to remove/avoid them in release build, so they will run only in debug builds, if the messages are needed for later retrieval it's better use other mechanism which are built for this purpose (collecting logs/errors)
Line 31 in e5606f3
Line 49 in e5606f3
hamagen-react-native/src/database/Database.js
Line 690 in a5e1d4d
hamagen-react-native/src/services/Tracker.ts
Line 197 in e5606f3
hamagen-react-native/src/services/Tracker.ts
Line 223 in e5606f3
chaimPaneth commented
You can add this code to App.tsx
useEffect(() => {
StatusBar.setBarStyle('dark-content');
Linking.addEventListener('url', (data) => {
navigationRef.current && onOpenedFromDeepLink(data.url, navigationRef.current);
});
// Add the following
if (!__DEV__) {
console.disableYellowBox = true;
// disable console. log in production
console.log = () => { };
console.info = () => { };
console.warn = () => { };
console.error = () => { };
console.debug = () => { };
}
}, []);