Made log level adjustable during runtime for ConsoleLogReceiver.cs.

Also renamed log levels to be pascal case.
This commit is contained in:
Harrison Deng 2021-05-09 03:11:01 -05:00
parent f275ff330d
commit 3049cccc3e
3 changed files with 6 additions and 6 deletions

View File

@ -7,7 +7,7 @@ namespace SimpleLogger
{
public string Identifier => "Console Logger";
public LogLevel Level => LogLevel.DEBUG;
public LogLevel Level { get; set; } = LogLevel.Debug;
public void Flush()
{

View File

@ -2,9 +2,9 @@ namespace SimpleLogger
{
public enum LogLevel : int
{
FATAL,
INFO,
WARNING,
DEBUG,
Fatal,
Info,
Warning,
Debug,
}
}

View File

@ -12,7 +12,7 @@ namespace SimpleLogger
/// </summary>
/// <param name="message">The message to log.</param>
/// <param name="level">The level of severity, by default, info.</param>
public static void Log(string message, LogLevel level = LogLevel.INFO) {
public static void Log(string message, LogLevel level = LogLevel.Info) {
foreach (ILogReceiver listener in listeners.Values)
{
if (level <= listener.Level) {