simplelogger/ConsoleLogReceiver.cs

22 lines
500 B
C#

using System;
using System.Diagnostics;
using SimpleLogger;
namespace SimpleLogger
{
public class ConsoleLogReceiver : ILogReceiver
{
public string Identifier => "Console Logger";
public LogLevel Level { get; set; } = LogLevel.Debug;
public void Flush()
{
}
public void LogMessage(string message, DateTime time, LogLevel level)
{
Console.WriteLine($"[{time.ToShortTimeString()}] [{level}]: {message}");
}
}
}