How to use the @sentry/browser.addBreadcrumb function in @sentry/browser

To help you get started, we’ve selected a few @sentry/browser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github magcius / noclip.website / src / main.ts View on Github external
}
        });

        // Set window title.
        document.title = `${sceneDesc.name} - ${sceneGroup.name} - noclip`;

        const sceneDescId = this._getCurrentSceneDescId()!;

        if (typeof gtag !== 'undefined') {
            gtag("event", "loadScene", {
                'event_category': "Scenes",
                'event_label': sceneDescId,
            });
        }

        Sentry.addBreadcrumb({
            category: 'loadScene',
            message: sceneDescId,
        });

        Sentry.configureScope((scope) => {
            scope.setExtra('sceneDescId', sceneDescId);
        });
    }
github casual-simulation / aux / src / aux-server / aux-web / shared / AppManager.ts View on Github external
logout() {
        if (this.user) {
            Sentry.addBreadcrumb({
                message: 'Logout',
                category: 'auth',
                type: 'default',
                level: Sentry.Severity.Info,
            });
            console.log('[AppManager] Logout');

            this.simulationManager.clear();
            this._user = null;
            this._setCurrentUsername(null);
            this._userSubject.next(null);
        }
    }
github getsentry / sentry / src / sentry / static / sentry / app / components / asyncComponent.tsx View on Github external
handleError(error, args) {
    const [stateKey] = args;
    if (error && error.responseText) {
      Sentry.addBreadcrumb({
        message: error.responseText,
        category: 'xhr',
        level: Sentry.Severity.Error,
      });
    }
    this.setState(prevState => {
      const loading = prevState.remainingRequests! > 1;
      const state: AsyncComponentState = {
        [stateKey]: null,
        errors: {
          ...prevState.errors,
          [stateKey]: error,
        },
        error: prevState.error || !!error,
        remainingRequests: prevState.remainingRequests! - 1,
        loading,
github wladich / nakarte / src / lib / logging / index.js View on Github external
function captureBreadcrumb(message, data={}) {
    data.url = window.location.toString();
    Sentry.addBreadcrumb({
        message, data
    });
}
github SayMoreX / saymore-x / app / errorHandling.ts View on Github external
export function sentryBreadCrumb(msg: string) {
  Sentry.addBreadcrumb({ message: msg });
}
github airbnb / lunar / packages / metrics / src / utils / captureBreadcrumb.ts View on Github external
export default function captureBreadcrumb(crumb: Breadcrumb) {
  if (Metrics.isSentryEnabled()) {
    addBreadcrumb(crumb);
  }
}