1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2025-07-13 01:20:22 +02:00
Files
Sonarr/NzbDrone.Core/Instrumentation/LogService.cs

37 lines
944 B
C#
Raw Normal View History

2013-09-12 15:42:01 -07:00
using NzbDrone.Core.Datastore;
2013-06-18 18:01:08 -07:00
using NzbDrone.Core.Instrumentation.Commands;
2013-09-10 23:33:47 -07:00
using NzbDrone.Core.Messaging;
using NzbDrone.Core.Messaging.Commands;
2013-02-23 11:38:25 -08:00
namespace NzbDrone.Core.Instrumentation
{
public interface ILogService
{
2013-06-04 17:49:53 -07:00
PagingSpec<Log> Paged(PagingSpec<Log> pagingSpec);
2013-02-23 11:38:25 -08:00
}
public class LogService : ILogService, IExecute<TrimLogCommand>, IExecute<ClearLogCommand>
2013-02-23 11:38:25 -08:00
{
private readonly ILogRepository _logRepository;
2013-03-05 11:58:53 -08:00
public LogService(ILogRepository logRepository)
2013-02-23 11:38:25 -08:00
{
_logRepository = logRepository;
}
2013-06-18 18:01:08 -07:00
public PagingSpec<Log> Paged(PagingSpec<Log> pagingSpec)
2013-02-23 11:38:25 -08:00
{
2013-06-18 18:01:08 -07:00
return _logRepository.GetPaged(pagingSpec);
2013-02-23 11:38:25 -08:00
}
2013-06-18 18:01:08 -07:00
public void Execute(TrimLogCommand message)
2013-02-23 11:38:25 -08:00
{
_logRepository.Trim();
}
public void Execute(ClearLogCommand message)
{
2013-08-08 00:38:14 -07:00
_logRepository.Purge();
}
2013-02-23 11:38:25 -08:00
}
}