예제 #1
0
        private SentryEvent CreateSentryEvent(Exception ex, string message)
        {
            var sentryEvent = new SentryEvent(ex);

            sentryEvent.Tags.Add("OS", _appInfoService.GetPlatform());
            sentryEvent.Tags.Add("Login", BasePresenter.User.Login);
            sentryEvent.Tags.Add("AppVersion", _appInfoService.GetAppVersion());
            sentryEvent.Tags.Add("AppBuild", _appInfoService.GetBuildVersion());
            sentryEvent.Tags.Add("Model", _appInfoService.GetModel());
            sentryEvent.Tags.Add("OsVersion", _appInfoService.GetOsVersion());
            sentryEvent.Message = message;
            return(sentryEvent);
        }
예제 #2
0
        private JsonPacket GetPacket()
        {
            var login = AppSettings.User?.Login;

            if (string.IsNullOrEmpty(login))
            {
                login = "******";
            }

            var appVersion   = _appInfoService.GetAppVersion();
            var buildVersion = _appInfoService.GetBuildVersion();

            return(new JsonPacket
            {
                Project = _dsn.ProjectID,
                Tags = new Dictionary <string, string>()
                {
                    { "OS", _appInfoService.GetPlatform() },
                    { "AppVersion", appVersion },
                    { "AppBuild", buildVersion },
                    { "Model", _appInfoService.GetModel() },
                    { "OsVersion", _appInfoService.GetOsVersion() },
                },
                User = new SentryUser(login),
                Release = $"{appVersion}.{buildVersion}"
            });
        }