-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxDebug.cs
34 lines (28 loc) · 1011 Bytes
/
xDebug.cs
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
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
#pragma warning disable IDE1006
namespace BSS.Logging
{
internal static class xDebug
{
internal static ConsoleColor DefaultForegroundColor;
internal static readonly Boolean IsInitialized = false;
[DllImport("kernel32.dll")]
static extern Boolean AllocConsole();
// # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
static xDebug()
{
#if DEBUG
if (Console.LargestWindowWidth == 0) AllocConsole();
DefaultForegroundColor = Console.ForegroundColor;
IsInitialized = true;
#endif
}
// # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
[Conditional("DEBUG")]
internal static void Write(Object input) => Console.Write(input);
[Conditional("DEBUG")]
internal static void WriteLine(Object input) => Console.WriteLine(input);
}
}