1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-26 17:57:43 +00:00
Sonarr/NzbDrone.Core/Instrumentation/LogService.cs
2013-08-08 00:38:14 -07:00

37 lines
No EOL
920 B
C#

using System;
using NzbDrone.Common.Messaging;
using NzbDrone.Core.Datastore;
using NzbDrone.Core.Instrumentation.Commands;
namespace NzbDrone.Core.Instrumentation
{
public interface ILogService
{
PagingSpec<Log> Paged(PagingSpec<Log> pagingSpec);
}
public class LogService : ILogService, IExecute<TrimLogCommand>, IExecute<ClearLogCommand>
{
private readonly ILogRepository _logRepository;
public LogService(ILogRepository logRepository)
{
_logRepository = logRepository;
}
public PagingSpec<Log> Paged(PagingSpec<Log> pagingSpec)
{
return _logRepository.GetPaged(pagingSpec);
}
public void Execute(TrimLogCommand message)
{
_logRepository.Trim();
}
public void Execute(ClearLogCommand message)
{
_logRepository.Purge();
}
}
}