Add debug log to Logger

This commit is contained in:
ChronosX88 2020-07-19 14:46:58 +04:00
parent 5be00542b8
commit 964223444a
3 changed files with 19 additions and 2 deletions

4
.gitignore vendored
View File

@ -1 +1,3 @@
/.config.toml /.config.toml
bin
obj

View File

@ -42,5 +42,9 @@ namespace Zirconium.Core.Logging
public static void Info(string message) { public static void Info(string message) {
_defaultLogger.Info(message); _defaultLogger.Info(message);
} }
public static void Debug(string message) {
_defaultLogger.Debug(message);
}
} }
} }

View File

@ -34,6 +34,12 @@ namespace Zirconium.Core.Logging
} }
} }
public void Debug(string message) {
if (_isVerbose) {
writeLog(LogType.Debug, message);
}
}
public void Fatal(string message) { public void Fatal(string message) {
writeLog(LogType.Fatal, message); writeLog(LogType.Fatal, message);
System.Environment.Exit(1); System.Environment.Exit(1);
@ -70,6 +76,10 @@ namespace Zirconium.Core.Logging
tagFormatter = new Formatter("WARNING", Color.Yellow); tagFormatter = new Formatter("WARNING", Color.Yellow);
break; break;
} }
case LogType.Debug: {
tagFormatter = new Formatter("DEBUG", Color.Lime);
break;
}
default: { default: {
tagFormatter = new Formatter("UNKNOWN", Color.Green); tagFormatter = new Formatter("UNKNOWN", Color.Green);
break; break;
@ -87,7 +97,8 @@ namespace Zirconium.Core.Logging
Error, Error,
Fatal, Fatal,
Info, Info,
Warning Warning,
Debug
} }
} }
} }