Skip to content

[cmd3, epilogue] Automatically log the v3 scheduler#8785

Open
SamCarlberg wants to merge 2 commits intowpilibsuite:2027from
SamCarlberg:commandsv3/epilogue-integration
Open

[cmd3, epilogue] Automatically log the v3 scheduler#8785
SamCarlberg wants to merge 2 commits intowpilibsuite:2027from
SamCarlberg:commandsv3/epilogue-integration

Conversation

@SamCarlberg
Copy link
Copy Markdown
Member

Epilogue logging is set up to capture fields and methods, which means that the scheduler would have to be logged by assigning it to a field or to a public Scheduler-returning method in a logged class.

This adds special handling to detect the v3 scheduler on the classpath and automatically log it under ${root}/Command Scheduler so users don't need to manually do so.

Users can opt out by turning off the corresponding configuration option:

Epilogue.configure(config -> {
  config.automaticallyLogCommandScheduler = false;
});

Epilogue logging is set up to capture fields and methods, which means that the scheduler would have to be logged by assigning it to a field or to a public Scheduler-returning method in a logged class.

This adds special handling to detect the v3 scheduler on the classpath and automatically log it under `${root}/Command Scheduler` so users don't need to manually log it
@SamCarlberg SamCarlberg requested a review from a team as a code owner April 19, 2026 21:56
@SamCarlberg SamCarlberg added component: epilogue Annotation-based logging library 2027 2027 target component: commands v3 WPILib Commands library version 3 labels Apr 19, 2026
@PeterJohnson
Copy link
Copy Markdown
Member

Why wouldn’t we just include Telemetry.log(“scheduler”, Scheduler.getInstance()) in the cmd3 template project? Special casing this feels a little weird.

@SamCarlberg
Copy link
Copy Markdown
Member Author

Why wouldn’t we just include Telemetry.log(“scheduler”, Scheduler.getInstance()) in the cmd3 template project? Special casing this feels a little weird

I figured it's easier to have the library handle it by default so people don't need to think about it.

We could include something similar in the v3 templates, too. I'd just be concerned about teams removing it (or cargo culting from other teams who removed it) and wondering why they're not getting scheduler telemetry.

@PeterJohnson
Copy link
Copy Markdown
Member

I don't see cargo culting as a counterargument here, as teams can just as easily cargo-cult the disable code. I mainly don't like it being quite so aggressively automatic when we have dedicated templates for command projects.

@Gold856
Copy link
Copy Markdown
Member

Gold856 commented Apr 22, 2026

Yeah, I think it's better to just have a Telemetry call in the template rather than special case it. Sure, some people might remove it via cargo culting, but most won't. It's also a little weird to have this one single exception in the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2027 2027 target component: commands v3 WPILib Commands library version 3 component: epilogue Annotation-based logging library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants