1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-27 10:19:41 +00:00
Radarr/NzbDrone.Core/Instrumentation/LogProvider.cs

32 lines
673 B
C#
Raw Normal View History

2011-06-18 00:11:12 +00:00
using System.Collections.Generic;
using System.Linq;
using NLog;
2011-06-18 00:11:12 +00:00
using PetaPoco;
using SubSonic.Repository;
namespace NzbDrone.Core.Instrumentation
{
public class LogProvider
{
2011-06-18 00:11:12 +00:00
private readonly IDatabase _database;
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
2011-06-18 00:11:12 +00:00
public LogProvider(IDatabase database)
{
2011-06-18 00:11:12 +00:00
_database = database;
}
2011-06-18 00:11:12 +00:00
public IList<Log> GetAllLogs()
{
2011-06-18 00:11:12 +00:00
return _database.Fetch<Log>();
}
public void DeleteAll()
{
2011-06-18 00:11:12 +00:00
_database.Delete<Log>("");
Logger.Info("Cleared Log History");
}
}
2011-04-10 02:44:01 +00:00
}