2019-09-03 19:27:57 +00:00
|
|
|
import { Client } from 'bugsnag-react-native';
|
2019-05-28 13:03:08 +00:00
|
|
|
import firebase from 'react-native-firebase';
|
2019-09-03 19:27:57 +00:00
|
|
|
import config from '../../config';
|
2018-05-18 17:55:08 +00:00
|
|
|
|
2019-09-03 19:27:57 +00:00
|
|
|
const bugsnag = new Client(config.BUGSNAG_API_KEY);
|
|
|
|
|
|
|
|
export const { analytics } = firebase;
|
|
|
|
export const loggerConfig = bugsnag.config;
|
|
|
|
export const { leaveBreadcrumb } = bugsnag;
|
|
|
|
|
|
|
|
export default (e) => {
|
2019-10-07 20:56:30 +00:00
|
|
|
if (e instanceof Error && !__DEV__) {
|
2019-09-03 19:27:57 +00:00
|
|
|
bugsnag.notify(e);
|
|
|
|
} else {
|
|
|
|
console.log(e);
|
2018-05-18 17:55:08 +00:00
|
|
|
}
|
|
|
|
};
|