Made log level adjustable during runtime for ConsoleLogReceiver.cs.
Also renamed log levels to be pascal case.
This commit is contained in:
parent
f275ff330d
commit
3049cccc3e
@ -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()
|
||||
{
|
||||
|
@ -2,9 +2,9 @@ namespace SimpleLogger
|
||||
{
|
||||
public enum LogLevel : int
|
||||
{
|
||||
FATAL,
|
||||
INFO,
|
||||
WARNING,
|
||||
DEBUG,
|
||||
Fatal,
|
||||
Info,
|
||||
Warning,
|
||||
Debug,
|
||||
}
|
||||
}
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user