mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
Data diagnostics opt-in
This commit is contained in:
@@ -69,6 +69,8 @@ namespace Microsoft.PowerToys.Settings.UI
|
||||
|
||||
public static Action<string> IPCMessageReceivedCallback { get; set; }
|
||||
|
||||
public ETWTrace EtwTrace { get; private set; } = new ETWTrace();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="App"/> class.
|
||||
/// Initializes the singleton application object. This is the first line of authored code
|
||||
@@ -78,6 +80,9 @@ namespace Microsoft.PowerToys.Settings.UI
|
||||
{
|
||||
Logger.InitializeLogger(@"\Settings\Logs");
|
||||
|
||||
EtwTrace = new ETWTrace();
|
||||
EtwTrace.Start();
|
||||
|
||||
string appLanguage = LanguageHelper.LoadLanguage();
|
||||
if (!string.IsNullOrEmpty(appLanguage))
|
||||
{
|
||||
@@ -87,6 +92,13 @@ namespace Microsoft.PowerToys.Settings.UI
|
||||
InitializeComponent();
|
||||
|
||||
UnhandledException += App_UnhandledException;
|
||||
|
||||
NativeEventWaiter.WaitForEventLoop(
|
||||
Constants.PowerToysRunnerTerminateSettingsEvent(), () =>
|
||||
{
|
||||
EtwTrace?.Dispose();
|
||||
Environment.Exit(0);
|
||||
});
|
||||
}
|
||||
|
||||
private void App_UnhandledException(object sender, Microsoft.UI.Xaml.UnhandledExceptionEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user