Created
July 7, 2021 22:55
-
-
Save gitumarkk/e6e85c9556fd5a704094ff098b06cd1f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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