Ejemplo n.º 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);
        }
Ejemplo n.º 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();
     }
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 5
0
 public static void WriteLine(object value)
 {
     Bugfender.LogMessage(value.ToString());
 }
Ejemplo n.º 6
0
 public static void WriteLine(string value)
 {
     Bugfender.LogMessage(value);
 }
Ejemplo n.º 7
0
        public static void WriteLine(string format, params object[] arg)
        {
            string message = String.Format(format, arg);

            Bugfender.LogMessage(message);
        }
Ejemplo n.º 8
0
 public static void WriteLine(char[] buffer, int index, int count)
 {
     Bugfender.LogMessage(new string(buffer, index, count));
 }
Ejemplo n.º 9
0
 public static void WriteLine()
 {
     Bugfender.LogMessage("");
 }
Ejemplo n.º 10
0
 public static void WriteLine(ValueType value)
 {
     Bugfender.LogMessage(value.ToString());
 }