Skip to content

Commit

Permalink
🔊 Capture log for 0 gas
Browse files Browse the repository at this point in the history
  • Loading branch information
nwingt committed Dec 10, 2020
1 parent ecb1a0b commit 0d72e49
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/utils/error.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sentryCaptureError } from './sentry'
import { sentryCaptureError, sentryCaptureMessage } from './sentry'

export function logError(err: any) {
if (__DEV__) {
Expand All @@ -8,3 +8,12 @@ export function logError(err: any) {
sentryCaptureError(err)
}
}

export function logMessage(msg: string) {
if (__DEV__) {
console.tron.warn(msg)
} else {
console.warn(msg)
sentryCaptureMessage(msg)
}
}
4 changes: 4 additions & 0 deletions app/utils/sentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ export function initSentry(dsn: string, environment: string) {
})
}

export function sentryCaptureMessage(msg: string) {
return Sentry.captureMessage(msg)
}

export function sentryCaptureError(err: unknown) {
return Sentry.captureException(err)
}
Expand Down

0 comments on commit 0d72e49

Please sign in to comment.