当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Sentry.captureBreadcrumb方法代码示例

本文整理汇总了TypeScript中react-native-sentry.Sentry.captureBreadcrumb方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Sentry.captureBreadcrumb方法的具体用法?TypeScript Sentry.captureBreadcrumb怎么用?TypeScript Sentry.captureBreadcrumb使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在react-native-sentry.Sentry的用法示例。


在下文中一共展示了Sentry.captureBreadcrumb方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: Date

      let promiseResolver = (result) => {
        if (result.error === true) {
          LOGi.bch("BluenetPromise: promise rejected in bridge: ", functionName, " error:", result.data, "for ID:", id);
          Sentry.captureBreadcrumb({
            category: 'ble',
            data: {
              functionCalled: functionName,
              t: new Date().valueOf(),
              state: 'failed',
              err: result.data
            }
          });
          reject(result.data);
        }
        else {
			LOGi.bch("BluenetPromise: promise resolved in bridge: ", functionName, " data:", result.data, "for ID:", id);
          Sentry.captureBreadcrumb({
            category: 'ble',
            data: {
              functionCalled: functionName,
              t: new Date().valueOf(),
              state: 'success',
            }
          });
          resolve(result.data);
        }
      };
开发者ID:crownstone,项目名称:CrownstoneApp,代码行数:27,代码来源:BluenetPromise.ts

示例2: cancelFallbackCallback

      .catch((err) => {
        LOG.info("Sync: Failed... Could dispatch ", actions.length, " actions!", actions);
        actions.forEach((action) => {
          action.triggeredBySync = true;
        });

        // if (actions.length > 0) {
        //   store.batchDispatch(actions);
        // }

        Sentry.captureBreadcrumb({
          category: 'sync',
          data: {
            state:'failed',
            err: err
          }
        });

        this.__currentlySyncing = false;
        this.__syncTriggerDatabaseEvents = true;
        cancelFallbackCallback();
        eventBus.emit("CloudSyncComplete");
        LOGe.cloud("Sync: error during sync:", err);

        throw err;
      })
开发者ID:crownstone,项目名称:CrownstoneApp,代码行数:26,代码来源:sync.ts

示例3: Promise

  return new Promise((resolve, reject) => {
	  let id = (Math.random() * 1e8).toString(36)
    if (DISABLE_NATIVE === true) {
      resolve()
    }
    else {
      Sentry.captureBreadcrumb({
        category: 'ble',
        data: {
          functionCalled: functionName,
          t: new Date().valueOf(),
          state: 'started',
        }
      });
      let bluenetArguments = [];
      let promiseResolver = (result) => {
        if (result.error === true) {
          LOGi.bch("BluenetPromise: promise rejected in bridge: ", functionName, " error:", result.data, "for ID:", id);
          Sentry.captureBreadcrumb({
            category: 'ble',
            data: {
              functionCalled: functionName,
              t: new Date().valueOf(),
              state: 'failed',
              err: result.data
            }
          });
          reject(result.data);
        }
        else {
			LOGi.bch("BluenetPromise: promise resolved in bridge: ", functionName, " data:", result.data, "for ID:", id);
          Sentry.captureBreadcrumb({
            category: 'ble',
            data: {
              functionCalled: functionName,
              t: new Date().valueOf(),
              state: 'success',
            }
          });
          resolve(result.data);
        }
      };

      // fill the bluenet arguments list with all arguments we will send to bluenet.
      for (let i = 1; i < arguments.length; i++) {
        bluenetArguments.push(arguments[i])
      }

      LOGi.bch("BluenetPromise: called bluenetPromise", functionName, " with params", bluenetArguments, "for ID:", id);

      // add the promise resolver to this list
      bluenetArguments.push(promiseResolver);
      Bluenet[functionName].apply(this, bluenetArguments);
    }
  })
开发者ID:crownstone,项目名称:CrownstoneApp,代码行数:55,代码来源:BluenetPromise.ts

示例4: return

  return (state, action) => {
    let result = reducer(state, action);
    if (action) {
      if (action.type == "REACT_NATIVE_ROUTER_FLUX_PUSH" || action.type == "REACT_NATIVE_ROUTER_FLUX_POP_TO" || action.type == "Navigation/BACK") {
        let name = getNameOfCurrentRoute(result)
        Sentry.captureBreadcrumb({
          message: 'User Navigated',
          category: 'navigation',
          data: {
            isOnRoute: name,
          }
        });
      }
    }

    return result;
  }
开发者ID:crownstone,项目名称:CrownstoneApp,代码行数:17,代码来源:navigation.ts

示例5: function

  _logOut: function(store, gracefulExit) {

    Sentry.captureBreadcrumb({
      category: 'logout',
      data: {
        state:'startLogOut'
      }
    });
    // TODO: Wait for possibly pending sync to stop
    eventBus.emit("showLoading", {text:lang("Logging_out_and_closing_a"), opacity:0.25});

    // clear position for this device.
    let state = store.getState();
    let deviceId = Util.data.getCurrentDeviceId(state);
    Actions.logout();

    // clear all events listeners, should fix a lot of redraw issues which will crash at logout
    eventBus.clearAllEvents();
    NativeBus.clearAllEvents();

    // sign out of all spheres.
    let sphereIds = Object.keys(state.spheres);
    sphereIds.forEach((sphereId) => {
      store.dispatch({type: 'SET_SPHERE_STATE', sphereId: sphereId, data: {reachable: false, present: false}});
    });

    BluenetPromiseWrapper.clearTrackedBeacons().catch(() => {});
    Bluenet.stopScanning();
    CLOUD.forDevice(deviceId).exitSphere("*")  // will also clear location
      .catch(() => {})
      .then(() => {
        return StoreManager.userLogOut()
      })
      .then(() => {
        LOG.info("Quit app due to logout.");
        gracefulExit();
      })
      .catch((err) => {
        LOGe.info("Could not log user out!", err);
        gracefulExit();
      });
  },
开发者ID:crownstone,项目名称:CrownstoneApp,代码行数:42,代码来源:AppUtil.ts

示例6: function

  sync: function (store, background = true) {
    if (this.__currentlySyncing) {
      LOG.info("SYNC: Skip Syncing, sync already in progress.");
      return new Promise((resolve, reject) => { resolve(true) });
    }

    let state = store.getState();
    if (!state.user.userId) {
      // do not sync if we're not logged in
      return;
    }

    let cancelFallbackCallback = Scheduler.scheduleBackgroundCallback(() => {
      if (this.__currentlySyncing === true) {
        this.__currentlySyncing = false;
      }
    }, 30000);

    LOG.info("Sync: Start Syncing.");
    this.__currentlySyncing = true;

    // set the authentication tokens
    let userId = state.user.userId;
    let accessToken = state.user.accessToken;
    CLOUD.setAccess(accessToken);
    CLOUD.setUserId(userId);

    eventBus.emit("CloudSyncStarting");

    Sentry.captureBreadcrumb({
      category: 'sync',
      data: {
        state:'start'
      }
    });

    let globalCloudIdMap = getGlobalIdMap();
    let globalSphereMap = {};

    let actions = [];
    let userSyncer = new UserSyncer(actions, [], globalCloudIdMap);

    LOG.info("Sync: START Sync Events.");
    return syncEvents(store)
      // in case the event sync fails, check if the user accessToken is invalid, try to regain it if that's the case and try again.
      .catch(getUserIdCheckError(state, store, () => {
        LOG.info("Sync: RETRY Sync Events.");
        return this.syncEvents(store);
      }))
      .then(() => {
        LOG.info("Sync: DONE Sync Events.");
        LOG.info("Sync: START userSyncer sync.");
        return userSyncer.sync(store)
      })
      .catch(getUserIdCheckError(state, store, () => {
        LOG.info("Sync: RETRY userSyncer Sync.");
        return userSyncer.sync(store)
      }))
      .then(() => {
        LOG.info("Sync: DONE userSyncer sync.");
        LOG.info("Sync: START FirmwareBootloader sync.");
        let firmwareBootloaderSyncer = new FirmwareBootloaderSyncer(actions, [], globalCloudIdMap);
        return firmwareBootloaderSyncer.sync(store);
      })
      .then(() => {
        LOG.info("Sync: DONE FirmwareBootloader sync.");
        LOG.info("Sync: START SphereSyncer sync.");
        let sphereSyncer = new SphereSyncer(actions, [], globalCloudIdMap, globalSphereMap);
        return sphereSyncer.sync(store);
      })
      .then(() => {
        LOG.info("Sync: DONE SphereSyncer sync.");
        LOG.info("Sync: START KeySyncer sync.");
        let keySyncer = new KeySyncer(actions, [], globalCloudIdMap);
        return keySyncer.sync(store);
      })
      .then(() => {
        LOG.info("Sync: DONE KeySyncer sync.");
        LOG.info("Sync: START DeviceSyncer sync.");
        let deviceSyncer = new DeviceSyncer(actions, [], globalCloudIdMap);
        return deviceSyncer.sync(state);
      })
      .then(() => {
        LOG.info("Sync: DONE DeviceSyncer sync.");
        LOG.info("Sync: START Fingerprint sync.");
        let fingerprintSyncer = new FingerprintSyncer(actions, [], globalCloudIdMap, globalSphereMap);
        return fingerprintSyncer.sync(state);
      })
      .then(() => {
        LOG.info("Sync: DONE Fingerprint sync.");
        LOG.info("Sync: START Preferences sync.");
        let preferenceSyncer = new PreferenceSyncer(actions, [], globalCloudIdMap);
        return preferenceSyncer.sync(state);
      })
      .then(() => {
        LOG.info("Sync: DONE Preferences sync.");
        LOG.info("Sync: START syncPowerUsage.");
        return syncPowerUsage(state, actions);
      })
      .then(() => {
//.........这里部分代码省略.........
开发者ID:crownstone,项目名称:CrownstoneApp,代码行数:101,代码来源:sync.ts


注:本文中的react-native-sentry.Sentry.captureBreadcrumb方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。