Skip to content

Instantly share code, notes, and snippets.

@gitumarkk
Created July 7, 2021 22:55
Show Gist options
  • Save gitumarkk/e6e85c9556fd5a704094ff098b06cd1f to your computer and use it in GitHub Desktop.
Save gitumarkk/e6e85c9556fd5a704094ff098b06cd1f to your computer and use it in GitHub Desktop.
/* eslint-disable no-empty, no-console */
import * as Sentry from '@sentry/react-native';
const ENABLE_LOG = __DEV__;
export default {
info: (...args: any): void => {
if (ENABLE_LOG) console.log(...args);
},
error: (...args: any): void => {
if (ENABLE_LOG) console.error(...args);
},
warn: (...args: any): void => {
if (ENABLE_LOG) console.warn(...args);
},
exception(error: any, params: any = {}): void {
if (ENABLE_LOG) console.error(error, params);
try {
Sentry.captureException(error, {
extra: params,
message: error.message,
data: error.data,
});
} catch (err) {}
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment