Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log action dispatch occurrence #17718

Merged
merged 4 commits into from
Aug 21, 2024
Merged

Log action dispatch occurrence #17718

merged 4 commits into from
Aug 21, 2024

Conversation

carlos-zamora
Copy link
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.

Copy link
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
Member

DHowett commented Aug 20, 2024

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

@zadjii-msft
Copy link
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
20 checks passed
@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
Status: To Cherry Pick
Development

Successfully merging this pull request may close these issues.

4 participants