/ src / modules / MouseUtils / FindMyMouse / trace.cpp
trace.cpp
 1  #include "pch.h"
 2  #include "trace.h"
 3  
 4  #include <common/Telemetry/TraceBase.h>
 5  
 6  TRACELOGGING_DEFINE_PROVIDER(
 7      g_hProvider,
 8      "Microsoft.PowerToys",
 9      // {38e8889b-9731-53f5-e901-e8a7c1753074}
10      (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74),
11      TraceLoggingOptionProjectTelemetry());
12  
13  // Log if the user has FindMyMouse enabled or disabled
14  void Trace::EnableFindMyMouse(const bool enabled) noexcept
15  {
16      TraceLoggingWriteWrapper(
17          g_hProvider,
18          "FindMyMouse_EnableFindMyMouse",
19          ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance),
20          TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE),
21          TraceLoggingBoolean(enabled, "Enabled"));
22  }
23  
24  // Log that the user activated the module by focusing the mouse pointer
25  void Trace::MousePointerFocused(const int activationMethod) noexcept
26  {
27      TraceLoggingWriteWrapper(
28          g_hProvider,
29          "FindMyMouse_MousePointerFocused",
30          ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance),
31          TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE),
32          TraceLoggingInt32(activationMethod, "ActivationMethod"));
33  }