コード例 #1
0
        public static ErrorReporter.OnError createSendOnError(
            string loggerName, Uri reportingUrl, ApiKeys keys, ErrorReporter.AppInfo appInfo,
            ExtraData addExtraData, bool onlySendUniqueErrors
            )
        {
            var sentJsonsOpt = onlySendUniqueErrors.opt(() => new HashSet <string>());

            return(data => {
                var msg = message(loggerName, keys, appInfo, data, addExtraData);
                Action send = () => ASync.NextFrame(() => msg.send(reportingUrl));
                sentJsonsOpt.voidFold(
                    send,
                    sentJsons => {
                    if (sentJsons.Add(msg.json))
                    {
                        send();
                    }
                    else if (Log.isDebug)
                    {
                        Log.rdebug($"Not sending duplicate Sentry msg: {msg}");
                    }
                }
                    );
            });
        }
コード例 #2
0
        static void WhenGameObjectDestroyed(GameObject go)
        {
            var sub = new Subject <Unit>().subscribeWhileAlive(go, _ => { });

            Assert.AreEqual(sub.isSubscribed, true);
            Destroy(go);
            ASync.NextFrame(() =>
                            Assert.AreEqual(sub.isSubscribed, false)
                            );
        }
コード例 #3
0
 public static ErrorReporter.OnError createEditorOnError(
     string apiKey, ErrorReporter.AppInfo appInfo
     )
 {
     return(data => ASync.NextFrame(() => {
         if (Log.isInfo)
         {
             Log.info("Airbrake error:\n\n" + data + "\n" + xml(apiKey, appInfo, data));
         }
     }));
 }
コード例 #4
0
 public static ErrorReporter.OnError createLogOnError(
     string loggerName, DSN dsn, ErrorReporter.AppInfo appInfo,
     ExtraData addExtraData
     )
 {
     return(data => ASync.NextFrame(() => {
         if (Log.isInfo)
         {
             Log.info(
                 $"Sentry error:\n\n{data}\nreporting url={dsn.reportingUrl}\n" +
                 message(loggerName, dsn.keys, appInfo, data, addExtraData)
                 );
         }
     }));
 }