Radeon Reset Bug fix service
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
RadeonResetBugFix/RadeonResetBugFixService/Logging/TaskLoggerWrapper.cs

26 lines
741 B

namespace RadeonResetBugFixService.Logging
{
using System;
using Contracts;
class TaskLoggerWrapper : ILogger
{
private ILogger InnerLogger { get; }
private string Prefix { get; }
public TaskLoggerWrapper(ILogger innerLogger, string taskName)
{
this.InnerLogger = innerLogger;
this.Prefix = $"[{taskName}]";
innerLogger.Log($"{this.Prefix} begin");
}
void ILogger.Log(string message) => this.InnerLogger.Log($"{this.Prefix} {message}");
void ILogger.LogError(string message) => this.InnerLogger.LogError($"{this.Prefix} {message}");
void IDisposable.Dispose() => this.InnerLogger.Log($"{this.Prefix} end");
}
}