cs-codex-dist-tests/Framework/Logging/LogPrefixer.cs

40 lines
938 B
C#
Raw Normal View History

2023-09-13 07:12:18 +00:00
namespace Logging
{
public class LogPrefixer : ILog
{
private readonly ILog backingLog;
private readonly string prefix;
public LogPrefixer(ILog backingLog, string prefix)
{
this.backingLog = backingLog;
this.prefix = prefix;
}
public LogFile CreateSubfile(string ext = "log")
{
return backingLog.CreateSubfile(ext);
}
public void Debug(string message = "", int skipFrames = 0)
{
backingLog.Debug(prefix + message, skipFrames);
}
public void Error(string message)
{
backingLog.Error(prefix + message);
}
public void Log(string message)
{
backingLog.Log(prefix + message);
}
2023-09-20 11:33:58 +00:00
public void AddStringReplace(string from, string to)
{
backingLog.AddStringReplace(from, to);
}
2023-09-13 07:12:18 +00:00
}
}