Feature/netcore preparation (#2072)

* Use platform detection that works on mono 4.6+

* Move to use package reference for restoring nuget packages.

* DateTimeRoutines does not have Nuget packages that support .NET Standard (and therefore .NET Core). We will have to include them for now until we can get rid of this dependency.

* Start spliting some interfaces into their own files - this will help by allowing us to split them out in the future into a seperate project so the actual implementations can stay within their respective architectures when required

* Move out common libraries

* Few more tidy up tasks to get things working with .NET Standard

* Restructure the solution layout

* Encoding work to reduce rework later on platforms without Windows codepages (or require compliance with RFC1345)

* Move folder structure around to have more natural layout of the solutions

* DI server configuration to get rid of "temporary" hack and dependency circle for serverservice

* Make all encoding consistent to match the expected encoding casing for earlier versions of mono.
This commit is contained in:
Nathan Holland
2017-11-05 22:42:03 +13:00
committed by flightlevel
parent 47a2ffa313
commit 571c52a0f2
235 changed files with 967 additions and 1001 deletions

View File

@@ -0,0 +1,50 @@
using Jackett.Models;
using NLog;
using NLog.Targets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Jackett.Services.Interfaces;
namespace Jackett.Services
{
[Target("LogService")]
public class LogCacheService: TargetWithLayout, ILogCacheService
{
private static List<CachedLog> logs = new List<CachedLog>();
public void AddLog(LogEventInfo l)
{
lock (logs)
{
logs.Insert(0, new CachedLog()
{
Level = l.Level.Name,
Message = l.Message,
When = l.TimeStamp
});
logs = logs.Take(50).ToList();
}
}
public List<CachedLog> Logs
{
get
{
lock (logs)
{
return logs.ToList();
}
}
}
protected override void Write(LogEventInfo logEvent)
{
AddLog(logEvent);
}
}
}