Skip to content

Commit

Permalink
Add some logging around tab renamer usage (#8520)
Browse files Browse the repository at this point in the history
We've got similar logging around the command palette, we really should have the same logging on the tab renamer as well.

## PR Checklist
* [x] I work here
* [ ] Tests added/passed
* [n/a] Requires documentation to be updated

## Validation Steps Performed

![image](https://user-images.githubusercontent.com/18356694/101487414-c237af80-3923-11eb-9997-81549e4f1a1b.png)
Look, it works
  • Loading branch information
zadjii-msft committed Dec 10, 2020
1 parent 540cc33 commit f751cad
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/cascadia/TerminalApp/TabHeaderControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ namespace winrt::TerminalApp::implementation
HeaderRenamerTextBox().Text(Title());
HeaderRenamerTextBox().SelectAll();
HeaderRenamerTextBox().Focus(Windows::UI::Xaml::FocusState::Programmatic);

TraceLoggingWrite(
g_hTerminalAppProvider, // handle to TerminalApp tracelogging provider
"TabRenamerOpened",
TraceLoggingDescription("Event emitted when the tab renamer is opened"),
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
TelemetryPrivacyDataTag(PDT_ProductAndServicePerformance));
}

// Method Description:
Expand All @@ -68,6 +75,18 @@ namespace winrt::TerminalApp::implementation
void TabHeaderControl::RenameBoxLostFocusHandler(Windows::Foundation::IInspectable const& /*sender*/,
Windows::UI::Xaml::RoutedEventArgs const& /*e*/)
{
// Log the data here, rather than in _CloseRenameBox. If we do it there,
// it'll get fired twice, once when the key is pressed to commit/cancel,
// and then again when the focus is lost

TraceLoggingWrite(
g_hTerminalAppProvider, // handle to TerminalApp tracelogging provider
"TabRenamerClosed",
TraceLoggingDescription("Event emitted when the tab renamer is closed"),
TraceLoggingBoolean(_renameCancelled, "CancelledRename", "True if the user cancelled the rename, false if they committed."),
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
TelemetryPrivacyDataTag(PDT_ProductAndServicePerformance));

_CloseRenameBox();
if (!_renameCancelled)
{
Expand Down

0 comments on commit f751cad

Please sign in to comment.