[chore:] logging for AddressPatch.cs
This commit is contained in:
@@ -3,6 +3,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using Logof_Client;
|
||||
|
||||
public class AddressPatch
|
||||
{
|
||||
@@ -57,6 +58,8 @@ public class AddressPatch
|
||||
public bool has_funktionad { get; set; }
|
||||
|
||||
public static AddressPatch Import(Uri filename)
|
||||
{
|
||||
try
|
||||
{
|
||||
var patch = new AddressPatch();
|
||||
|
||||
@@ -92,9 +95,20 @@ public class AddressPatch
|
||||
|
||||
return patch;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Log($"Error while importing address patch: {ex.Message}", Logger.LogType.Error);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
try
|
||||
{
|
||||
var properties = GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance);
|
||||
var stringProps = properties.Where(p => p.PropertyType == typeof(string) && p.Name.EndsWith("_is"));
|
||||
@@ -115,4 +129,12 @@ public class AddressPatch
|
||||
|
||||
return lines.ToString().TrimEnd();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Log($"Error while parsing: {ex.Message}", Logger.LogType.Error);
|
||||
}
|
||||
|
||||
return "Error while parsing";
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user