Open coderabbitai[bot] opened 1 month ago
In (Finn's PR #15)[https://github.com/frc5183/robot/pull/15] I use FRC's DataLogs and I think either using that or NetworkTables are the best solutions for what kind of logger to use.
However, the actual method is a harder question.
In that PR I used a path based system with paths for each main package inside the codebase, and logs could "reference" other modules (like a motor) by using a UUID that was added to every class.
This was pretty convoluted and caused a lot of work to find the reference. Now, it could've been better if AdvantageScope (or other logging software) could recognize these references and either show the data or a link to the data; however, this would mean implementing it ourselves in, for example, a fork of AdvantageScope.
TLDR: I do think it is important to be able to reference other data being logged however I can't think of a way to do it yet.
On another note, that logger was also very slow, and needed to either be moved to our only spare thread or optimized to hell.
On the performance side, that PR used a "log everything" philosophy in addition to "compression/supression" (this wasn't in the PR but was done on local machine and never pushed) that would count the number of repeated messages and then log it once the value changes. While I do like both of these, they cause the execution to run very slow. Because we want to see what went wrong during, for example, a competition match, we don't really want log levels as we always want as much informative data as possible; therefore, we should as much logs as possible without sacrificing performance.
Also, the logger in this old system was entirely handled by the class, which meant that almost always variables were only logged when they were otherwise accessed. While this would be fine, since there's no point in logging a variable that can only be changed by something like a SEU, classes were also responsible for ensuring every access of a variable was correctly logged, easily allowing for certain methods to be forgotten.
A much easier system would be something like Monologue or Oblog.
I think this will be the style of logger we'll use, now the question is should we use these prebuilt solutions or develop one of our own inspired by them?
As per the conversation in PR #4, specifically this comment, we need to initiate a discussion on how we should implement logging and telemetry in our project.
One option to consider is using AdvantageScope. Let's discuss the merits and potential integration strategies.
cc @Baconing