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

Add command composition logging callback to log current state. #7853

Open
blaze-developer opened this issue Mar 5, 2025 · 2 comments
Open
Labels
type: feature Brand new functionality, features, pages, workflows, endpoints, etc.

Comments

@blaze-developer
Copy link

While working with the Command framework in WPILib, our team has found it useful to log the current state of command compositions to a log file for debugging purposes. Being able to track the currently running command alongside other key data (like motor measurements, odometry, and behaviors) can be crucial for identifying issues and analyzing the robot’s behavior. However, there is currently no simple way to do this in the framework.

There are alternative ways to do this, such as creating a command that logs a string and placing it between composed commands. We have done this, however, it becomes very inconvenient to manage this logging, and an integrated callback, similar to the logging callbacks through SysId, would be amazing to have. This would simplify, and create more idiomatic code for teams.

@blaze-developer blaze-developer added the type: feature Brand new functionality, features, pages, workflows, endpoints, etc. label Mar 5, 2025
@sciencewhiz
Copy link
Contributor

There's some discussion about some of the difficulties of logging composed commands even if there were callbacks here: https://www.chiefdelphi.com/t/logging-commands/475631

@blaze-developer
Copy link
Author

Most of the discussion I see there is stating that it would be a struggle to implement some sort of simple ".logged()" factory method. Which I agree with, however allowing the user to have a callback with a command object, it allows the user to specify how they use that data, and how to log it. So they could log the name of the class, or categorize it in any way they like. Is there something I'm missing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature Brand new functionality, features, pages, workflows, endpoints, etc.
Projects
None yet
Development

No branches or pull requests

2 participants