Added commands to delete logs and log files (separately)

This commit is contained in:
Mark McDowall 2013-08-07 20:18:26 -07:00
commit 1274c1c144
12 changed files with 191 additions and 28 deletions

View file

@ -1,4 +1,5 @@
using NzbDrone.Common.Messaging;
using System;
using NzbDrone.Common.Messaging;
using NzbDrone.Core.Datastore;
using NzbDrone.Core.Instrumentation.Commands;
@ -9,7 +10,7 @@ namespace NzbDrone.Core.Instrumentation
PagingSpec<Log> Paged(PagingSpec<Log> pagingSpec);
}
public class LogService : ILogService, IExecute<TrimLogCommand>
public class LogService : ILogService, IExecute<TrimLogCommand>, IExecute<ClearLogCommand>
{
private readonly ILogRepository _logRepository;
@ -27,5 +28,10 @@ namespace NzbDrone.Core.Instrumentation
{
_logRepository.Trim();
}
public void Execute(ClearLogCommand message)
{
_logRepository.DeleteAll();
}
}
}