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


Java UserBuilder类代码示例

本文整理汇总了Java中io.sentry.event.UserBuilder的典型用法代码示例。如果您正苦于以下问题:Java UserBuilder类的具体用法?Java UserBuilder怎么用?Java UserBuilder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


UserBuilder类属于io.sentry.event包,在下文中一共展示了UserBuilder类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initSentryOnCurrentThread

import io.sentry.event.UserBuilder; //导入依赖的package包/类
public static void initSentryOnCurrentThread() {

		Sentry.init("https://2eb0fc30f86a4871a85755ecdde11679:[email protected]/252970");
		Sentry.getContext().setUser(new UserBuilder().setUsername("RoboTricker").build());
		Sentry.getContext().addTag("thread", Thread.currentThread().getName());
		Sentry.getContext().addTag("version", TransportPipes.instance.getDescription().getVersion());

		Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {

			@Override
			public void uncaughtException(Thread t, Throwable e) {
				Sentry.capture(e);
			}
		});

	}
 
开发者ID:RoboTricker,项目名称:Transport-Pipes,代码行数:17,代码来源:TransportPipes.java

示例2: getUserBuilder

import io.sentry.event.UserBuilder; //导入依赖的package包/类
@NonNull
private UserBuilder getUserBuilder(ReadableMap user) {
    UserBuilder userBuilder = new UserBuilder();
    if (user.hasKey("email")) {
        userBuilder.setEmail(user.getString("email"));
    }
    if (user.hasKey("userID")) {
        userBuilder.setId(user.getString("userID"));
    } else if (user.hasKey("userId")) {
        userBuilder.setId(user.getString("userId"));
    } else if (user.hasKey("id")) {
        userBuilder.setId(user.getString("id"));
    }
    if (user.hasKey("username")) {
        userBuilder.setUsername(user.getString("username"));
    }
    if (user.hasKey("extra")) {
        userBuilder.setData(((ReadableNativeMap)user.getMap("extra")).toHashMap());
    }
    return userBuilder;
}
 
开发者ID:getsentry,项目名称:react-native-sentry,代码行数:22,代码来源:RNSentryModule.java

示例3: initClient

import io.sentry.event.UserBuilder; //导入依赖的package包/类
@PostConstruct
private void initClient() {
	if (isSentryEnabled) {
		LOGGER.info("Enabling Sentry for errors/crashes reporting");
		// initialize sentry
		Sentry.init();
		// configure user for sentry
		User sentryUser = new UserBuilder().setUsername(appName).build();
		Sentry.getContext().setUser(sentryUser);
		// add additional information to sentry
		Sentry.getContext().addTag("tagName", appVersion);
	} else {
		LOGGER.info("Sentry is not enabled by properties, so crashes/errors are not reporting on it");
	}
}
 
开发者ID:lucapompei,项目名称:WebTemplate,代码行数:16,代码来源:SentryConfig.java

示例4: setUser

import io.sentry.event.UserBuilder; //导入依赖的package包/类
@ReactMethod
public void setUser(ReadableMap user) {
    UserBuilder userBuilder = getUserBuilder(user);
    User builtUser = userBuilder.build();
    if (builtUser.getId() != null) {
        Sentry.setUser(builtUser);
    }
}
 
开发者ID:getsentry,项目名称:react-native-sentry,代码行数:9,代码来源:RNSentryModule.java


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