using System.Text; using InnovEnergy.Lib.Utils; namespace InnovEnergy.Logging; public static class Extensions { private const Char NewLine = '\n'; public static Byte[] Serialize(this Exception e) { return Encoding.UTF8.GetBytes(e.Message + NewLine + e); } public static (String title, String message) Deserialize(this IReadOnlyList data) { var strData = data .ToArray() .Apply(Encoding.UTF8.GetString); return (strData.UntilFirst(NewLine), strData.AfterFirst(NewLine)); } }