You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using System;
|
|
|
|
|
using NzbDrone.Core.Instrumentation;
|
|
|
|
|
using Lidarr.Http.REST;
|
|
|
|
|
|
|
|
|
|
namespace Lidarr.Api.V1.Logs
|
|
|
|
|
{
|
|
|
|
|
public class LogResource : RestResource
|
|
|
|
|
{
|
|
|
|
|
public DateTime Time { get; set; }
|
|
|
|
|
public string Exception { get; set; }
|
|
|
|
|
public string ExceptionType { get; set; }
|
|
|
|
|
public string Level { get; set; }
|
|
|
|
|
public string Logger { get; set; }
|
|
|
|
|
public string Message { get; set; }
|
|
|
|
|
public string Method { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static class LogResourceMapper
|
|
|
|
|
{
|
|
|
|
|
public static LogResource ToResource(this Log model)
|
|
|
|
|
{
|
|
|
|
|
if (model == null) return null;
|
|
|
|
|
|
|
|
|
|
return new LogResource
|
|
|
|
|
{
|
|
|
|
|
Id = model.Id,
|
|
|
|
|
|
|
|
|
|
Time = model.Time,
|
|
|
|
|
Exception = model.Exception,
|
|
|
|
|
ExceptionType = model.ExceptionType,
|
|
|
|
|
Level = model.Level,
|
|
|
|
|
Logger = model.Logger,
|
|
|
|
|
Message = model.Message
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|