mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-14 11:23:42 +02:00
28 lines
649 B
C#
28 lines
649 B
C#
using System.Linq;
|
|
using NLog;
|
|
using SubSonic.Repository;
|
|
|
|
namespace NzbDrone.Core.Instrumentation
|
|
{
|
|
public class LogProvider
|
|
{
|
|
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
|
private readonly IRepository _repository;
|
|
|
|
public LogProvider(IRepository repository)
|
|
{
|
|
_repository = repository;
|
|
}
|
|
|
|
public IQueryable<Log> GetAllLogs()
|
|
{
|
|
return _repository.All<Log>();
|
|
}
|
|
|
|
public void DeleteAll()
|
|
{
|
|
_repository.DeleteMany(GetAllLogs());
|
|
Logger.Info("Cleared Log History");
|
|
}
|
|
}
|
|
} |