1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-10-31 07:52:37 +01:00
Sonarr/NzbDrone.Core/Instrumentation/LogProvider.cs

30 lines
627 B
C#
Raw Normal View History

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