KFDtool/sw/control/KFDtool.Gui/App.xaml.cs

29 lines
887 B
C#
Raw Normal View History

2020-08-01 08:12:20 -06:00
using NLog;
using System;
2019-07-29 15:24:10 -06:00
using System.Windows;
namespace KFDtool.Gui
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
2020-08-01 08:12:20 -06:00
private static Logger Log = LogManager.GetCurrentClassLogger();
public App()
{
AppDomain currentDomain = AppDomain.CurrentDomain;
currentDomain.UnhandledException += CurrentDomain_UnhandledException;
}
private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
Exception ex = (Exception)e.ExceptionObject;
Log.Error("UnhandledException caught: {0}", ex.Message);
Log.Error("UnhandledException StackTrace: {0}", ex.StackTrace);
Log.Fatal("Runtime terminating: {0}", e.IsTerminating);
}
2019-07-29 15:24:10 -06:00
}
}