-
Notifications
You must be signed in to change notification settings - Fork 0
/
Debug.cs
44 lines (39 loc) · 1.11 KB
/
Debug.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
35
36
37
38
39
40
41
42
43
44
using System;
namespace JC.MiniLisp_Interpreter
{
public class Debug
{
/// <summary>
/// If true, only white-colored output will be printed
/// </summary>
public static bool UseQuiet = false;
/// <summary>
/// If true, Debug.Log will print out logs.
/// </summary>
public static bool UseDebug = false;
/// <summary>
/// Debug Log
/// </summary>
/// <param name="log"></param>
public static void Log(object log)
{
if(UseDebug)
{
Print(log, ConsoleColor.DarkGray);
}
}
/// <summary>
/// Colorful Console.WriteLine
/// </summary>
/// <param name="log"></param>
/// <param name="color"></param>
public static void Print(object log, ConsoleColor color = ConsoleColor.White)
{
if(UseQuiet && color != ConsoleColor.White)
return;
Console.ForegroundColor = color;
Console.WriteLine(log);
Console.ResetColor();
}
}
}