2
0
mirror of synced 2025-01-11 17:14:25 +00:00
2023-09-20 13:33:58 +02:00

40 lines
938 B
C#

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);
}
public void AddStringReplace(string from, string to)
{
backingLog.AddStringReplace(from, to);
}
}
}