mirror of
https://github.com/real-zony/ZonyLrcToolsX.git
synced 2025-09-05 13:07:26 +00:00
42 lines
1.1 KiB
C#
42 lines
1.1 KiB
C#
using System;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.Extensions.Logging;
|
|
using ZonyLrcTools.Common.Infrastructure.DependencyInject;
|
|
using ZonyLrcTools.Common.Infrastructure.Logging;
|
|
|
|
namespace ZonyLrcTools.Cli.Infrastructure.Logging;
|
|
|
|
public class SerilogWarpLogger : IWarpLogger, ITransientDependency
|
|
{
|
|
private readonly ILogger<SerilogWarpLogger> _logger;
|
|
|
|
public SerilogWarpLogger(ILogger<SerilogWarpLogger> logger)
|
|
{
|
|
_logger = logger;
|
|
}
|
|
|
|
public Task DebugAsync(string message, Exception exception = null)
|
|
{
|
|
_logger.LogDebug(message, exception);
|
|
|
|
return Task.CompletedTask;
|
|
}
|
|
|
|
public Task InfoAsync(string message, Exception exception = null)
|
|
{
|
|
_logger.LogInformation(message, exception);
|
|
return Task.CompletedTask;
|
|
}
|
|
|
|
public Task WarnAsync(string message, Exception exception = null)
|
|
{
|
|
_logger.LogWarning(message, exception);
|
|
return Task.CompletedTask;
|
|
}
|
|
|
|
public Task ErrorAsync(string message, Exception exception = null)
|
|
{
|
|
_logger.LogError(message, exception);
|
|
return Task.CompletedTask;
|
|
}
|
|
} |