Merge pull request #2720 from mono/fix-39325
[mono.git] / mcs / class / System / System.Diagnostics / DefaultTraceListener.cs
index 5d56d24b44747d63dfa4485cee3b997716e84e24..fb31ace627b679a46f3b9eece4154858108a0c14 100644 (file)
@@ -64,14 +64,10 @@ namespace System.Diagnostics {
                        OnWin32 = (Path.DirectorySeparatorChar == '\\');
 
                        if (!OnWin32) {
-#if TARGET_JVM
-                               string trace = java.lang.System.getProperty("MONO_TRACE");
-#else
                                // If we're running on Unix, we don't have OutputDebugString.
                                // Instead, send output to...wherever the MONO_TRACE_LISTENER environment
                                // variables says to.
                                String trace = Environment.GetEnvironmentVariable("MONO_TRACE_LISTENER");
-#endif
 
 #if MOBILE
                                if (trace == null)
@@ -144,6 +140,7 @@ namespace System.Diagnostics {
                {
                }
 
+               [MonoTODO ("AssertUiEnabled defaults to False; should follow Environment.UserInteractive.")]
                public bool AssertUiEnabled {
                        get { return assertUiEnabled; }
                        set { assertUiEnabled = value; }
@@ -163,11 +160,14 @@ namespace System.Diagnostics {
                public override void Fail (string message, string detailMessage)
                {
                        base.Fail (message, detailMessage);
+#if !MOBILE
                        if (ProcessUI (message, detailMessage) == DialogResult.Abort)
                                Thread.CurrentThread.Abort ();
+#endif
                        WriteLine (new StackTrace().ToString());
                }
 
+#if !MOBILE
                DialogResult ProcessUI (string message, string detailMessage)
                {
                        
@@ -213,11 +213,8 @@ namespace System.Diagnostics {
                        Ignore,
                        Abort
                }
+#endif
 
-#if TARGET_JVM
-               private void WriteDebugString (string message)
-               {
-#else
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                private extern static void WriteWindowsDebugString (string message);
 
@@ -226,7 +223,6 @@ namespace System.Diagnostics {
                        if (OnWin32)
                                WriteWindowsDebugString (message);
                        else
-#endif
                                WriteMonoTrace (message);
                }
 
@@ -259,10 +255,10 @@ namespace System.Diagnostics {
                                WritePrefix ();
                        }
 
-                       WriteDebugString (message);
-
                        if (Debugger.IsLogging())
                                Debugger.Log (0, null, message);
+                       else
+                               WriteDebugString (message);
 
                        WriteLogFile (message, LogFileName);
                }