|
@@ -19,6 +19,10 @@ namespace InABox.Avalonia
|
|
|
private static Logger _logger = null;
|
|
|
|
|
|
private static string _logfilenameincludingpath;
|
|
|
+
|
|
|
+ public delegate void ExceptionHandler(Exception ex, string? tag);
|
|
|
+
|
|
|
+ public static event ExceptionHandler? LogException;
|
|
|
|
|
|
private static Logger CheckLogger()
|
|
|
{
|
|
@@ -57,8 +61,19 @@ namespace InABox.Avalonia
|
|
|
CheckLogger()
|
|
|
.Information("{Log}", message);
|
|
|
}
|
|
|
+
|
|
|
+ public static void LogError(string message)
|
|
|
+ {
|
|
|
+ CheckLogger()
|
|
|
+ .Error("{Log}", message);
|
|
|
+ }
|
|
|
|
|
|
public static void Log(Exception exception, String tag = "")
|
|
|
+ {
|
|
|
+ LogException?.Invoke(exception, tag);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void LogExceptionMessage(Exception exception, string tag = "")
|
|
|
{
|
|
|
CheckLogger();
|
|
|
if (String.IsNullOrWhiteSpace(tag))
|