public App() { string profilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"GitBlame\Profile"); Directory.CreateDirectory(profilePath); ProfileOptimization.SetProfileRoot(profilePath); ProfileOptimization.StartProfile("Startup"); Log.DebugFormat("Starting new application; version {0}.", Assembly.GetExecutingAssembly().GetName().Version); m_analyticsClient = new GoogleAnalyticsClient("UA-25641987-2", "GitBlame", new GoogleAnalyticsStatisticsProvider()); #if !DEVELOPMENT BugSense.Init("w8cfcffb"); #endif AppDomain.CurrentDomain.UnhandledException += (s, ea) => { var exception = ea.ExceptionObject as Exception; if (exception != null) { Log.FatalFormat("Unhandled Exception: {0} {1}", exception, exception.GetType(), exception.Message); #if !DEVELOPMENT m_analyticsClient.SubmitExceptionAsync(exception, true); #endif } else { Log.FatalFormat("Unhandled Error: {0}", ea.ExceptionObject); } }; m_app = new AppModel(); }
private static void CurrentDomainOnUnhandledException(object sender, UnhandledExceptionEventArgs unhandledExceptionEventArgs) { // Pop a GUI var e = (Exception)unhandledExceptionEventArgs.ExceptionObject; BugSense.SendException(e); throw e; }
private static void Main() { //try //{ Task.Factory.StartNew(() => { NLog.LogManager.ThrowExceptions = true; LogTo.Debug("Initialize BugSense"); BugSense.Init("9eacbe2e", GetVersion(), "http://www.bugsense.com/api/errors"); AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException; LogTo.Debug("Initializing advanced JIT"); AdvancedJIT.SetupJIT(); }); LogTo.Debug("Building IOC container"); ContainerSetup containerSetup = new ContainerSetup(); var container = containerSetup.BuildWinFormsContainer(); //var container = containerSetup.BuildAvalonContainer(); LogTo.Debug("Running ITerminal"); if (container.IsRegistered <InitableRunner>()) { container.Resolve <InitableRunner>().Init(); } container.Resolve <ITerminal>().Run(); //} //catch (Exception e) //{ // LogTo.Fatal(e.Message); // BugSense.SendException(e); // MessageBox.Show(e.Message, "Unhandled exception"); //} }
public App() { BugSense.Init(BugsenseApiKey); }
public App() { BugSense.Init(BugsenseApiKey); BugSense.AddExtra("foo", "bar"); BugSense.AddExtra("bacon", "awesome"); }