-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbetterLogs.ts
More file actions
26 lines (25 loc) · 803 Bytes
/
betterLogs.ts
File metadata and controls
26 lines (25 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { LogBox } from "react-native";
if (__DEV__) {
const ignoreWarns = [
// need to be fixed by the libraries authors
"ViewPropTypes",
// probably because expo-firebase-recaptcha is deprecated
"No native ExpoFirebaseCore",
// can be safely ignored since it's development only
"SerializableStateInvariantMiddleware",
//
"Constants.platform.ios.model",
];
const warn = console.warn;
console.warn = (...arg) => {
if (arg.some((s) => ignoreWarns.some((w) => s.includes?.(w)))) return;
else warn(...arg);
};
const ignoreErrors = ["ViewPropTypes"];
const error = console.error;
console.error = (...arg) => {
if (arg.some((s) => ignoreErrors.some((w) => s.includes?.(w)))) return;
else error(...arg);
};
LogBox.ignoreLogs(ignoreWarns);
}