From f7880dd6e03b527bca962955a84af7e3733622cb Mon Sep 17 00:00:00 2001 From: sheychen Date: Thu, 19 Jan 2017 12:48:20 +0100 Subject: [PATCH] Logger Colors Unification --- MyCommon/Logger.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/MyCommon/Logger.cs b/MyCommon/Logger.cs index 69a059d..5f6886d 100755 --- a/MyCommon/Logger.cs +++ b/MyCommon/Logger.cs @@ -10,7 +10,7 @@ namespace MyCommon { public class Logger { - public enum logType { dev, debug, info, warm, error, fatal } + public enum logType { dev = 0, debug, info, warm, error, fatal } public enum logConsole { normal, show, hide } @@ -93,6 +93,13 @@ namespace MyCommon } } + if (consoleType != ConsoleTypes.Any) + { + Console.BackgroundColor = logBackColor[0]; + Console.ForegroundColor = logForeColor[0]; + Console.Clear(); + } + int i = 0; while (File.Exists(logPath + "/" + DateTime.UtcNow.ToString("yyyy-MM-dd-", CultureInfo.InvariantCulture) + i + ".log")) { i++; } logPath = logPath + "/" + DateTime.UtcNow.ToString("yyyy-MM-dd-", CultureInfo.InvariantCulture) + i + ".log"; @@ -105,7 +112,7 @@ namespace MyCommon { _run = false; Updater.Join(); - } + } public void ChangeLevel(logType level) {