Radarr/src/NzbDrone.Api/Logs/LogResource.cs

39 lines
989 B
C#
Raw Normal View History

2013-06-05 00:49:53 +00:00
using System;
2018-11-23 07:03:32 +00:00
using Radarr.Http.REST;
2013-06-05 00:49:53 +00:00
namespace NzbDrone.Api.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 static class LogResourceMapper
{
public static LogResource ToResource(this Core.Instrumentation.Log model)
{
2019-12-22 22:08:53 +00:00
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
};
}
2013-06-05 00:49:53 +00:00
}
}