예제 #1
0
        private void LogToLoggerClient (LogLevel level, string tag, string message, Exception exc)
        {
            if (level >= LogLevel.Warning) {
                ErrorSeverity severity;

                switch (level) {
                case LogLevel.Warning:
                    severity = ErrorSeverity.Warning;
                    break;
                case LogLevel.Error:
                    severity = ErrorSeverity.Error;
                    break;
                default:
                    severity = ErrorSeverity.Info;
                    break;
                }

                var md = new Metadata ();
                md.AddToTab ("Logger", "Tag", tag);
                md.AddToTab ("Logger", "Message", message);
                AddExtraMetadata (md);

                var loggerClient = ServiceContainer.Resolve<ILoggerClient> ();

                if (loggerClient != null) {
                    loggerClient.Notify (exc, severity, md);
                }
            }
        }
예제 #2
0
        protected override void AddExtraMetadata (Metadata md)
        {
            var settings = ServiceContainer.Resolve<SettingsStore> ();
            md.AddToTab ("State", "Experiment", settings.ExperimentId);
            md.AddToTab ("State", "Read duration only notice", settings.ReadDurOnlyNotice ? "Yes" : "No");

            md.AddToTab ("Settings", "Show projects for new", settings.ChooseProjectForNew ? "Yes" : "No");
            md.AddToTab ("Settings", "Add default tag", settings.UseDefaultTag ? "Yes" : "No");
        }
예제 #3
0
        protected override void AddExtraMetadata (Metadata md)
        {
            var settings = ServiceContainer.Resolve<SettingsStore> ();
            md.AddToTab ("State", "Experiment", settings.ExperimentId);
            md.AddToTab ("State", "Push registered", String.IsNullOrWhiteSpace (settings.GcmRegistrationId) ? "No" : "Yes");

            md.AddToTab ("Settings", "Show projects for new", settings.ChooseProjectForNew ? "Yes" : "No");
            md.AddToTab ("Settings", "Idle notifications", settings.IdleNotification ? "Yes" : "No");
            md.AddToTab ("Settings", "Add default tag", settings.UseDefaultTag ? "Yes" : "No");
        }
예제 #4
0
        protected override void AddExtraMetadata (Metadata md)
        {
            var settings = ServiceContainer.Resolve<SettingsStore> ();
            md.AddToTab ("State", "Experiment", settings.ExperimentId);
            md.AddToTab ("State", "Push registered", String.IsNullOrWhiteSpace (settings.GcmRegistrationId) ? "No" : "Yes");
            md.AddToTab ("State", "Got welcome message", settings.GotWelcomeMessage ? "Yes" : "No");
            md.AddToTab ("State", "Read recent continue notice", settings.ReadContinueDialog ? "Yes" : "No");
            md.AddToTab ("State", "Read duration only notice", settings.ReadDurOnlyNotice ? "Yes" : "No");

            md.AddToTab ("Settings", "Show projects for new", settings.ChooseProjectForNew ? "Yes" : "No");
            md.AddToTab ("Settings", "Idle notifications", settings.IdleNotification ? "Yes" : "No");
            md.AddToTab ("Settings", "Add default tag", settings.UseDefaultTag ? "Yes" : "No");
        }
예제 #5
0
        public void Notify (Exception e, ErrorSeverity severity = ErrorSeverity.Error, Metadata extraMetadata = null)
        {
            #if (!DEBUG)
            var extraData = new Dictionary<string, string> ();
            foreach (var item in extraMetadata) {
                if (item.Value != null) {
                    var data = item.Value.ToObject<Dictionary<string, string>>();
                    foreach (var i in data) {
                        extraData.Add ( item.Key + ":" + i.Key, i.Value);
                    }
                }
            }

            var tags = new List<string> { Enum.GetName (typeof (ErrorSeverity), severity) };
            RaygunClient.Current.SendInBackground (e, tags, extraData);
            #endif
        }
예제 #6
0
        public void Notify (Exception e, ErrorSeverity severity = ErrorSeverity.Error, Metadata extraMetadata = null)
        {
            var extraData = new Dictionary<string, string> ();
            foreach (var item in extraMetadata) {
                if (item.Value != null) {
                    var data = item.Value.ToObject<Dictionary<string, string>>();
                    foreach (var i in data) {
                        extraData.Add ( item.Key + ":" + i.Key, i.Value);
                    }
                }
            }

            if (severity == ErrorSeverity.Info) {
                Insights.Track ("Info", extraData);
            } else {
                var reportSeverity = severity == ErrorSeverity.Warning
                                     ? Insights.Severity.Warning : Insights.Severity.Error;

                Insights.Report (e, extraData, reportSeverity);
            }
        }
예제 #7
0
 protected abstract void AddExtraMetadata (Metadata md);
예제 #8
0
 public Metadata (Metadata other) : base (other)
 {
 }
예제 #9
0
 protected abstract void AddExtraMetadata(Metadata md);