コード例 #1
0
        private static void UnobservedTaskExceptionHandler(object sender, UnobservedTaskExceptionEventArgs unobservedTaskExceptionEventArgs)
        {
            var title  = unobservedTaskExceptionEventArgs.Exception.ToString();
            var detail = unobservedTaskExceptionEventArgs.Exception.StackTrace;

            if (detail == null)
            {
                detail = "";
            }
            detail = "```\nTask Scheduler exception\n\n" + detail + "\n```";
            Bugfender.SendIssueWithTitle(title, detail);
        }
コード例 #2
0
 public static void EnableXamarinCrashReporting()
 {
     // Besides calling EnableCrashReporting, also installs some handlers at the Mono level
     Mono.Runtime.RemoveSignalHandlers();
     try {
         Bugfender.EnableCrashReporting();
         AppDomain.CurrentDomain.UnhandledException += Bugfender.AppDomainExceptionHandler;
         TaskScheduler.UnobservedTaskException      += Bugfender.UnobservedTaskExceptionHandler;
     }
     finally
     {
         Mono.Runtime.InstallSignalHandlers();
     }
 }
コード例 #3
0
        private static void AppDomainExceptionHandler(object sender, UnhandledExceptionEventArgs unhandledExceptionEventArgs)
        {
            var e     = unhandledExceptionEventArgs.ExceptionObject as Exception;
            var title = e.Message;

            if (title == null)
            {
                title = e.ToString();
            }
            var detail = e.StackTrace;

            if (detail == null)
            {
                detail = "";
            }
            detail = "```\nApp Domain, current domain exception\n\n" + detail + "\n```";
            Bugfender.SendIssueWithTitle(title, detail);
        }
コード例 #4
0
        private static void LogMessage(string message)
        {
            StackFrame frame = new StackTrace(true).GetFrame(2);

            nint       lineNumber = frame.GetFileLineNumber();
            string     method     = frame.GetMethod().Name;
            string     file       = Path.GetFileName(frame.GetFileName());
            BFLogLevel level      = BFLogLevel.Default;
            string     tag        = "";

            if (method == null)
            {
                method = "";
            }
            if (file == null)
            {
                file = "";
            }

            Bugfender.Log(lineNumber, method, file, level, tag, message);
            Console.WriteLine("{0} ({1}:{2}) {3}", method, file, lineNumber, message);
        }
コード例 #5
0
 public static void WriteLine(object value)
 {
     Bugfender.LogMessage(value.ToString());
 }
コード例 #6
0
 public static void WriteLine(string value)
 {
     Bugfender.LogMessage(value);
 }
コード例 #7
0
        public static void WriteLine(string format, params object[] arg)
        {
            string message = String.Format(format, arg);

            Bugfender.LogMessage(message);
        }
コード例 #8
0
 public static void WriteLine(char[] buffer, int index, int count)
 {
     Bugfender.LogMessage(new string(buffer, index, count));
 }
コード例 #9
0
 public static void WriteLine()
 {
     Bugfender.LogMessage("");
 }
コード例 #10
0
 public static void WriteLine(ValueType value)
 {
     Bugfender.LogMessage(value.ToString());
 }