Data diagnostics opt-in

This commit is contained in:
Stefan Markovic
2024-09-24 13:47:38 +02:00
parent 2146dff3bf
commit bea3607ea0
242 changed files with 2546 additions and 1283 deletions

View File

@@ -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)