Files
tbd-station-14/Content.Server/Administration/Logs/Converters/AdminLogConverter.cs
Leon Friedrich 828b1f2044 Rejig LogStringHandler (#30706)
* Rejig LogStringHandler

* Fix session logs

* Fix properly

* comments

* IAsType support

* Fix mind logs

* Fix mind logging AGAIN

---------

Co-authored-by: PJB3005 <pieterjan.briers+git@gmail.com>
2025-09-05 14:22:49 +02:00

35 lines
911 B
C#

using System.Text.Json;
using System.Text.Json.Serialization;
namespace Content.Server.Administration.Logs.Converters;
public interface IAdminLogConverter
{
void Init(IDependencyCollection dependencies);
/// <summary>
/// Called after all converters have been added to the <see cref="JsonSerializerOptions"/>.
/// </summary>
void Init2(JsonSerializerOptions options)
{
}
}
public abstract class AdminLogConverter<T> : JsonConverter<T>, IAdminLogConverter
{
public virtual void Init(IDependencyCollection dependencies)
{
}
public virtual void Init2(JsonSerializerOptions options)
{
}
public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
throw new NotSupportedException();
}
public abstract override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options);
}