mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-11-16 01:55:27 +00:00
30 lines
900 B
C#
30 lines
900 B
C#
|
using System;
|
|||
|
using System.Text.Json.Serialization;
|
|||
|
|
|||
|
namespace Ryujinx.Common.Logging
|
|||
|
{
|
|||
|
internal class LogEventArgsJson
|
|||
|
{
|
|||
|
public LogLevel Level { get; }
|
|||
|
public TimeSpan Time { get; }
|
|||
|
public string ThreadName { get; }
|
|||
|
|
|||
|
public string Message { get; }
|
|||
|
public string Data { get; }
|
|||
|
|
|||
|
[JsonConstructor]
|
|||
|
public LogEventArgsJson(LogLevel level, TimeSpan time, string threadName, string message, string data = null)
|
|||
|
{
|
|||
|
Level = level;
|
|||
|
Time = time;
|
|||
|
ThreadName = threadName;
|
|||
|
Message = message;
|
|||
|
Data = data;
|
|||
|
}
|
|||
|
|
|||
|
public static LogEventArgsJson FromLogEventArgs(LogEventArgs args)
|
|||
|
{
|
|||
|
return new LogEventArgsJson(args.Level, args.Time, args.ThreadName, args.Message, DynamicObjectFormatter.Format(args.Data));
|
|||
|
}
|
|||
|
}
|
|||
|
}
|