1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-17 00:13:15 +01:00
Radarr/NzbDrone.Core/Instrumentation/LogService.cs

37 lines
920 B
C#
Raw Normal View History

using System;
using NzbDrone.Common.Messaging;
2013-06-05 02:49:53 +02:00
using NzbDrone.Core.Datastore;
2013-06-19 03:01:08 +02:00
using NzbDrone.Core.Instrumentation.Commands;
2013-02-23 20:38:25 +01:00
namespace NzbDrone.Core.Instrumentation
{
public interface ILogService
{
2013-06-05 02:49:53 +02:00
PagingSpec<Log> Paged(PagingSpec<Log> pagingSpec);
2013-02-23 20:38:25 +01:00
}
public class LogService : ILogService, IExecute<TrimLogCommand>, IExecute<ClearLogCommand>
2013-02-23 20:38:25 +01:00
{
private readonly ILogRepository _logRepository;
2013-03-05 20:58:53 +01:00
public LogService(ILogRepository logRepository)
2013-02-23 20:38:25 +01:00
{
_logRepository = logRepository;
}
2013-06-19 03:01:08 +02:00
public PagingSpec<Log> Paged(PagingSpec<Log> pagingSpec)
2013-02-23 20:38:25 +01:00
{
2013-06-19 03:01:08 +02:00
return _logRepository.GetPaged(pagingSpec);
2013-02-23 20:38:25 +01:00
}
2013-06-19 03:01:08 +02:00
public void Execute(TrimLogCommand message)
2013-02-23 20:38:25 +01:00
{
_logRepository.Trim();
}
public void Execute(ClearLogCommand message)
{
2013-08-08 09:38:14 +02:00
_logRepository.Purge();
}
2013-02-23 20:38:25 +01:00
}
}