using FluentFTP;
using Microsoft.Extensions.Logging;
namespace Dpz.Core.Service.ObjectStorage;
public class FtpLogger(ILogger<FtpLogger> logger) : IFtpLogger
{
public void Log(FtpLogEntry entry)
{
switch (entry.Severity)
{
case FtpTraceLevel.Verbose:
logger.LogDebug(exception:entry.Exception, message: entry.Message);
break;
case FtpTraceLevel.Info:
logger.LogInformation(exception:entry.Exception, message: entry.Message);
break;
case FtpTraceLevel.Warn:
logger.LogWarning(exception:entry.Exception, message: entry.Message);
break;
case FtpTraceLevel.Error:
logger.LogError(exception:entry.Exception, message: entry.Message);
break;
default:
logger.LogInformation(exception:entry.Exception, message: entry.Message);
break;
}
}
}