[epilogue] Log internal debug data to the configured logger instead of NT (#7040)

This commit is contained in:
Brandon Shen
2024-09-07 10:52:21 -07:00
committed by GitHub
parent b38e06c7cb
commit 3ad35a5753
2 changed files with 4 additions and 4 deletions

View File

@@ -167,7 +167,7 @@ public class EpilogueGenerator {
+ StringUtils.loggerFieldName(mainRobotClass)
+ ".tryUpdate(config.dataLogger.getSubLogger(config.root), robot, config.errorHandler);");
out.println(
" edu.wpi.first.networktables.NetworkTableInstance.getDefault().getEntry(\"Epilogue/Stats/Last Run\").setDouble((System.nanoTime() - start) / 1e6);");
" config.dataLogger.log(\"Epilogue/Stats/Last Run\", (System.nanoTime() - start) / 1e6);");
out.println(
" }, config.loggingPeriod.in(Seconds), config.loggingPeriodOffset.in(Seconds));");
out.println(" }");

View File

@@ -166,7 +166,7 @@ class EpilogueGeneratorTest {
robot.addPeriodic(() -> {
long start = System.nanoTime();
exampleLogger.tryUpdate(config.dataLogger.getSubLogger(config.root), robot, config.errorHandler);
edu.wpi.first.networktables.NetworkTableInstance.getDefault().getEntry("Epilogue/Stats/Last Run").setDouble((System.nanoTime() - start) / 1e6);
config.dataLogger.log(\"Epilogue/Stats/Last Run\", (System.nanoTime() - start) / 1e6);
}, config.loggingPeriod.in(Seconds), config.loggingPeriodOffset.in(Seconds));
}
}
@@ -237,7 +237,7 @@ class EpilogueGeneratorTest {
robot.addPeriodic(() -> {
long start = System.nanoTime();
alphaBotLogger.tryUpdate(config.dataLogger.getSubLogger(config.root), robot, config.errorHandler);
edu.wpi.first.networktables.NetworkTableInstance.getDefault().getEntry("Epilogue/Stats/Last Run").setDouble((System.nanoTime() - start) / 1e6);
config.dataLogger.log(\"Epilogue/Stats/Last Run\", (System.nanoTime() - start) / 1e6);
}, config.loggingPeriod.in(Seconds), config.loggingPeriodOffset.in(Seconds));
}
@@ -260,7 +260,7 @@ class EpilogueGeneratorTest {
robot.addPeriodic(() -> {
long start = System.nanoTime();
betaBotLogger.tryUpdate(config.dataLogger.getSubLogger(config.root), robot, config.errorHandler);
edu.wpi.first.networktables.NetworkTableInstance.getDefault().getEntry("Epilogue/Stats/Last Run").setDouble((System.nanoTime() - start) / 1e6);
config.dataLogger.log("Epilogue/Stats/Last Run", (System.nanoTime() - start) / 1e6);
}, config.loggingPeriod.in(Seconds), config.loggingPeriodOffset.in(Seconds));
}
}