Skip to content

Log action dispatch occurrence#17718

Merged
DHowett merged 4 commits intomainfrom
dev/cazamor/telem/action-usage
Aug 21, 2024
Merged

Log action dispatch occurrence#17718
DHowett merged 4 commits intomainfrom
dev/cazamor/telem/action-usage

Conversation

@carlos-zamora
Copy link
Copy Markdown
Member

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.

Comment thread src/cascadia/TerminalApp/ShortcutActionDispatch.cpp Outdated
Comment thread src/cascadia/TerminalApp/ShortcutActionDispatch.cpp Outdated
Comment thread src/cascadia/TerminalApp/ShortcutActionDispatch.cpp Outdated
Copy link
Copy Markdown
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay big-picture feedback:

I feel like exposing GenerateID() via the ActionAndArgs projection feels like an ick. The IDs probably shouldn't be something that we ever expose externally, right?

We do have the ShortcutAction Action on the args. Granted, that's a enum value, and idk if there's a trivial way for us to convert that enum value label to a string in the TerminalApp library. But I'd rather expose something like ShortcutActionToString(ShortcutAction a), and call ShortcutActionToString(actionAndArgs.Action()), rather than expose the ID.

(i also know this is for a relatively trivial tracelogging request that we probably don't want to overengineer for)

Thoughts?

@DHowett
Copy link
Copy Markdown
Member

DHowett commented Aug 20, 2024

Do we need to log specific actions? Can we just log action types?

@zadjii-msft
Copy link
Copy Markdown
Member

That's a fair point. If we don't care about the string names of the actions themselves, then we can just write out the ShortcutAction value itself and call it a day.

We'd have to be careful in the future to make sure to append-only to that list, but that doesn't seem like the end of the world.

@DHowett DHowett enabled auto-merge (squash) August 20, 2024 22:33
@carlos-zamora carlos-zamora added the Needs-Second It's a PR that needs another sign-off label Aug 21, 2024
@microsoft-github-policy-service microsoft-github-policy-service Bot removed the Needs-Second It's a PR that needs another sign-off label Aug 21, 2024
@DHowett DHowett merged commit 56cfb77 into main Aug 21, 2024
@DHowett DHowett deleted the dev/cazamor/telem/action-usage branch August 21, 2024 23:29
DHowett pushed a commit that referenced this pull request Aug 22, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: To Cherry Pick

Development

Successfully merging this pull request may close these issues.

4 participants