Skip to content

Instantly share code, notes, and snippets.

@mhutch
Created September 6, 2013 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhutch/6468258 to your computer and use it in GitHub Desktop.
Save mhutch/6468258 to your computer and use it in GitHub Desktop.
diff --git a/main/external/nrefactory b/main/external/nrefactory
--- a/main/external/nrefactory
+++ b/main/external/nrefactory
@@ -1 +1 @@
-Subproject commit a87d4cf3c543cde2257fb06e2f7ad15a8d50b375
+Subproject commit a87d4cf3c543cde2257fb06e2f7ad15a8d50b375-dirty
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs
index e7ec264..b20b9b2 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs
@@ -46,10 +46,7 @@ using MonoDevelop.Components.Commands;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Ide.Gui;
-using MonoDevelop.Core.Execution;
using MonoDevelop.Core.Instrumentation;
-using System.Diagnostics;
-using MonoDevelop.Projects;
using System.Collections.Generic;
using MonoDevelop.Core.LogReporting;
@@ -497,6 +494,36 @@ namespace MonoDevelop.Ide
Xwt.Application.UnhandledException += (sender, e) => {
HandleException (e.ErrorException, false);
};
+
+ System.Diagnostics.Debug.Listeners.Clear ();
+ System.Diagnostics.Debug.Listeners.Add (new AssertLoggingTraceListener ());
+ }
+
+ class AssertLoggingTraceListener : System.Diagnostics.TraceListener
+ {
+ public override void Fail (string message, string detailMessage)
+ {
+ string msg;
+ if (!string.IsNullOrEmpty (detailMessage)) {
+ msg = string.Format ("Failed assert: {0} - {1}", message, detailMessage);
+ } else {
+ msg = string.Format ("Failed assert: {0}", message);
+ }
+#if DEBUG
+ var stackTrace = new System.Diagnostics.StackTrace (1, true);
+ LoggingService.LogError (msg + "\n" + stackTrace);
+#else
+ LoggingService.LogError (msg);
+#endif
+ }
+
+ public override void Write (string message)
+ {
+ }
+
+ public override void WriteLine (string message)
+ {
+ }
}
void HandleException (Exception ex, bool willShutdown)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment