Skip to content

Commit f2e9041

Browse files
carlos-zamoraDHowett
authored andcommitted
Log action dispatch occurrence (#17718)
Some simple logic to report whenever an action has successfully occurred (and what ShortcutAction was used). Note, there will be some false positives here from startup. I noticed we get a `newTab` on launch. This is probably a result of restoring the window layout of the previous session since we're using ActionAndArgs for that. (cherry picked from commit 56cfb77) Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgSCpCo Service-Version: 1.21
1 parent 8e7137d commit f2e9041

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/cascadia/TerminalApp/ShortcutActionDispatch.cpp

+14-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,20 @@ namespace winrt::TerminalApp::implementation
4848
default:
4949
return false;
5050
}
51-
return eventArgs.Handled();
51+
const auto handled = eventArgs.Handled();
52+
53+
if (handled)
54+
{
55+
TraceLoggingWrite(
56+
g_hTerminalAppProvider,
57+
"ActionDispatched",
58+
TraceLoggingDescription("Event emitted when an action was successfully performed"),
59+
TraceLoggingValue(static_cast<int>(actionAndArgs.Action()), "Action"),
60+
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
61+
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage));
62+
}
63+
64+
return handled;
5265
}
5366

5467
bool ShortcutActionDispatch::DoAction(const ActionAndArgs& actionAndArgs)

0 commit comments

Comments
 (0)