AdvantageKit icon indicating copy to clipboard operation
AdvantageKit copied to clipboard

Catch Exceptions in Robot Lifecycle and log them

Open blaze-developer opened this issue 8 months ago • 0 comments

I apologize for the repost (#184)

While debugging matches that had exceptions thrown, needing to go to the driver station to find a DSEvents log containing a stack trace is often inconvenient. Along with this, the formatting in DSEvents files can be very hard to follow for stack traces.

It could be simpler and more readable to have this information in one place, the robot log file, which we download after every match. This aims to solve this problem by catching exceptions when they are thrown, logging them to the console, logging them to the log file, and continuing to pass them up in order to not interfere with the exception any further.

This should log every exception from user code, aside from errors during construction and initialization, unless the user decides to use the robotInit() method for the majority of their instantiation.

blaze-developer avatar Apr 26 '25 16:04 blaze-developer