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.
Lidarr/NzbDrone.Core/Instrumentation/LogService.cs

39 lines
995 B

using System.Linq;
using NLog;
using NzbDrone.Common;
namespace NzbDrone.Core.Instrumentation
{
public interface ILogService
{
void DeleteAll();
void Trim();
}
public class LogService : ILogService
{
private readonly ILogRepository _logRepository;
private readonly DiskProvider _diskProvider;
private readonly EnvironmentProvider _environmentProvider;
private readonly Logger _logger;
public LogService(ILogRepository logRepository, DiskProvider diskProvider,
EnvironmentProvider environmentProvider, Logger logger)
{
_logRepository = logRepository;
_diskProvider = diskProvider;
_environmentProvider = environmentProvider;
_logger = logger;
}
public void DeleteAll()
{
_logRepository.Purge();
}
public void Trim()
{
_logRepository.Trim();
}
}
}