logging.tsx 328 B

12345678910111213
  1. import * as Sentry from '@sentry/react';
  2. export function logException(ex: Error, context?: any): void {
  3. Sentry.withScope(scope => {
  4. if (context) {
  5. scope.setExtra('context', context);
  6. }
  7. Sentry.captureException(ex);
  8. });
  9. /* eslint no-console:0 */
  10. window.console && console.error && console.error(ex);
  11. }