forked from xyzzer/WinRTXamlToolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDebug.cs
More file actions
51 lines (44 loc) · 1.43 KB
/
Copy pathDebug.cs
File metadata and controls
51 lines (44 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System.Diagnostics;
using DiagnosticsDebug = System.Diagnostics.Debug;
namespace WinRTXamlToolkit.Debugging
{
public static class Debug
{
public static bool TraceToDebugger = true;
public static bool TraceToDebugConsoleOverlay = true;
[Conditional("DEBUG")]
public static void WriteLine(string format, params object[] args)
{
if (TraceToDebugger)
DiagnosticsDebug.WriteLine(format, args);
if (TraceToDebugConsoleOverlay)
DC.Trace(format, args);
}
[Conditional("DEBUG")]
public static void WriteLine(string message)
{
if (TraceToDebugger)
DiagnosticsDebug.WriteLine(message);
if (TraceToDebugConsoleOverlay)
DC.Trace(message);
}
[Conditional("DEBUG")]
public static void WriteLine(object value)
{
if (TraceToDebugger)
DiagnosticsDebug.WriteLine(value);
if (TraceToDebugConsoleOverlay)
DC.Trace((value ?? "<null>").ToString());
}
[Conditional("DEBUG")]
public static void Assert(bool condition)
{
DiagnosticsDebug.Assert(condition);
}
[Conditional("DEBUG")]
public static void Assert(bool condition, string message)
{
DiagnosticsDebug.Assert(condition, message);
}
}
}