using System.Threading;
namespace System.Diagnostics {
-#if NET_2_0
-#else
- [ComVisible(false)]
-#endif
public class DefaultTraceListener : TraceListener {
private static readonly bool OnWin32;
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");
+
+#if MOBILE
+ if (trace == null)
+ trace = ConsoleOutTrace;
#endif
if (trace != null) {
{
}
+ [MonoTODO ("AssertUiEnabled defaults to False; should follow Environment.UserInteractive.")]
public bool AssertUiEnabled {
get { return assertUiEnabled; }
set { assertUiEnabled = value; }
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)
{
Ignore,
Abort
}
+#endif
-#if TARGET_JVM
- private void WriteDebugString (string message)
- {
-#else
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern static void WriteWindowsDebugString (string message);
if (OnWin32)
WriteWindowsDebugString (message);
else
-#endif
WriteMonoTrace (message);
}
WritePrefix ();
}
- WriteDebugString (message);
-
if (Debugger.IsLogging())
Debugger.Log (0, null, message);
+ else
+ WriteDebugString (message);
WriteLogFile (message, LogFileName);
}