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

@@ -1,6 +1,8 @@
#include "pch.h"
#include "trace.h"
#include <common/Telemetry/TraceBase.h>
TRACELOGGING_DEFINE_PROVIDER(
g_hProvider,
"Microsoft.PowerToys",
@@ -8,23 +10,14 @@ TRACELOGGING_DEFINE_PROVIDER(
(0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74),
TraceLoggingOptionProjectTelemetry());
void Trace::RegisterProvider()
{
TraceLoggingRegister(g_hProvider);
}
void Trace::UnregisterProvider()
{
TraceLoggingUnregister(g_hProvider);
}
// Log if the user has CmdNotFound enabled or disabled
void Trace::EnableCmdNotFoundGpo(const bool enabled) noexcept
{
TraceLoggingWrite(
TraceLoggingWriteWrapper(
g_hProvider,
"CmdNotFound_EnableCmdNotFound",
ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance),
TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE),
TraceLoggingEventTag(MICROSOFT_EVENTTAG_DROP_PII),
TraceLoggingBoolean(enabled, "Enabled"));
}