vpr/ShadowStream/LogHelper/LogHelper.cs

43 lines
941 B
C#

using System;
using System.Collections.Generic;
//namespace Scheckenrennen_GUI.modules
//Quinn Grafe Schnecken rennen
namespace ShadowStream.LogHelper
{
public class LogHelper
{
private List<string> logEntries;
public LogHelper()
{
logEntries = new List<string>();
}
public void Log(string entry)
{
AddEntry($"[{DateTime.Now:HH:mm:ss}] [INFO ] {entry}");
}
public void Warn(string entry)
{
AddEntry($"[{DateTime.Now:HH:mm:ss}] [WARN ] {entry}");
}
public void Error(string entry)
{
AddEntry($"[{DateTime.Now:HH:mm:ss}] [ERROR] {entry}");
}
private void AddEntry(string entry)
{
logEntries.Add(entry);
}
public List<string> GetEntries()
{
return logEntries;
}
}
}