Skip to content

Commit 56cfb77

Browse files
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.
1 parent 628e99f commit 56cfb77

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

src/cascadia/TerminalApp/ShortcutActionDispatch.cpp

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

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

0 commit comments

Comments
 (0)