1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/NzbDrone.Core/Instrumentation/LogService.cs

39 lines
995 B
C#
Raw Normal View History

2013-02-23 22:38:25 +03:00
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();
}
}
}