Skip to content

Commit 65e8cef

Browse files
authored
feat: 2027 (#99)
## Info DogLog v2027 documentation is available here: [2027.doglog.dev](https://2027.doglog.dev) To install, change your `doglog.json` vendordep to point to `https://2027.doglog.dev/vendordep.json`. ## To-do list - [x] Update WPILib - [x] Update test project WPILib - [x] Remove `LogThread` - [x] Update `formatting-a-usb-drive.mdoc` guide - [x] Add a snippet to this issue on how to install - [ ] Remove differentiation between logging to a file vs NT (all logging is done via NT, and that's auto-captured to a log file) - [ ] Update the SystemCore discussion repo - [ ] Make a Chief Delphi post - [x] Publish docs to 2027.doglog.dev - [ ] Update "Capturing console output" documentation if `lvuser` home directory is no longer accurate
1 parent 679ba29 commit 65e8cef

11 files changed

Lines changed: 88 additions & 105 deletions

File tree

lib/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ tasks.withType(JavaCompile).configureEach {
4747
}
4848
}
4949

50-
ext.wpilibVersion = "2026.+"
50+
ext.wpilibVersion = "2027.+"
5151

5252
repositories {
5353
// Use Maven Central for resolving dependencies.
@@ -59,13 +59,15 @@ if (project.hasProperty('releaseMode')) {
5959
} else {
6060
wpilibRepositories.addAllDevelopmentRepositories(project)
6161
}
62+
wpilibRepositories.use2027Repos()
6263

6364
dependencies {
6465
implementation "edu.wpi.first.ntcore:ntcore-java:$wpilibVersion"
6566
implementation "edu.wpi.first.wpilibj:wpilibj-java:$wpilibVersion"
6667
implementation "edu.wpi.first.wpiutil:wpiutil-java:$wpilibVersion"
6768
implementation "edu.wpi.first.wpiunits:wpiunits-java:$wpilibVersion"
6869
implementation "edu.wpi.first.hal:hal-java:$wpilibVersion"
70+
implementation "edu.wpi.first.datalog:datalog-java:$wpilibVersion"
6971
implementation "edu.wpi.first.wpilibNewCommands:wpilibNewCommands-java:$wpilibVersion"
7072

7173
errorprone "com.google.errorprone:error_prone_core:2.49.0"

lib/src/main/java/dev/doglog/DogLog.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import dev.doglog.internal.TimedCommand;
77
import dev.doglog.internal.tunable.Tunable;
88
import dev.doglog.internal.writers.LogWriterHighLevel;
9-
import edu.wpi.first.hal.FRCNetComm;
109
import edu.wpi.first.hal.HAL;
1110
import edu.wpi.first.hal.HALUtil;
1211
import edu.wpi.first.networktables.BooleanSubscriber;
@@ -34,9 +33,7 @@
3433
/** A logger based on WPILib's {@link DataLogManager} */
3534
public class DogLog {
3635
static {
37-
HAL.report(
38-
FRCNetComm.tResourceType.kResourceType_LoggingFramework,
39-
FRCNetComm.tInstances.kLoggingFramework_DogLog);
36+
HAL.reportUsage("LoggingFramework", "DogLog");
4037
}
4138

4239
/** The options to use for the logger. */

lib/src/main/java/dev/doglog/internal/extras/ExtrasLogger.java

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,16 @@ private void log() {
7979
}
8080

8181
private void logSystem(long now) {
82-
logger.log(now, "SystemStats/FPGAVersion", false, HALUtil.getFPGAVersion());
83-
logger.log(now, "SystemStats/FPGARevision", false, HALUtil.getFPGARevision());
8482
logger.log(now, "SystemStats/SerialNumber", false, HALUtil.getSerialNumber());
8583
logger.log(now, "SystemStats/Comments", false, HALUtil.getComments());
8684
logger.log(now, "SystemStats/TeamNumber", false, HALUtil.getTeamNumber());
87-
logger.log(now, "SystemStats/FPGAButton", false, HALUtil.getFPGAButton());
8885
logger.log(now, "SystemStats/SystemActive", false, HAL.getSystemActive());
8986
logger.log(now, "SystemStats/BrownedOut", false, HAL.getBrownedOut());
9087
logger.log(now, "SystemStats/RSLState", false, HAL.getRSLState());
9188
logger.log(now, "SystemStats/SystemTimeValid", false, HAL.getSystemTimeValid());
9289

9390
logger.log(
9491
now, "SystemStats/BatteryVoltage", false, PowerJNI.getVinVoltage(), VOLTS_UNIT_STRING);
95-
logger.log(
96-
now, "SystemStats/BatteryCurrent", false, PowerJNI.getVinCurrent(), AMPS_UNIT_STRING);
9792

9893
logger.log(
9994
now, "SystemStats/3v3Rail/Voltage", false, PowerJNI.getUserVoltage3V3(), VOLTS_UNIT_STRING);
@@ -102,20 +97,6 @@ private void logSystem(long now) {
10297
logger.log(now, "SystemStats/3v3Rail/Active", false, PowerJNI.getUserActive3V3());
10398
logger.log(now, "SystemStats/3v3Rail/CurrentFaults", false, PowerJNI.getUserCurrentFaults3V3());
10499

105-
logger.log(
106-
now, "SystemStats/5vRail/Voltage", false, PowerJNI.getUserVoltage5V(), VOLTS_UNIT_STRING);
107-
logger.log(
108-
now, "SystemStats/5vRail/Current", false, PowerJNI.getUserCurrent5V(), AMPS_UNIT_STRING);
109-
logger.log(now, "SystemStats/5vRail/Active", false, PowerJNI.getUserActive5V());
110-
logger.log(now, "SystemStats/5vRail/CurrentFaults", false, PowerJNI.getUserCurrentFaults5V());
111-
112-
logger.log(
113-
now, "SystemStats/6vRail/Voltage", false, PowerJNI.getUserVoltage6V(), VOLTS_UNIT_STRING);
114-
logger.log(
115-
now, "SystemStats/6vRail/Current", false, PowerJNI.getUserCurrent6V(), AMPS_UNIT_STRING);
116-
logger.log(now, "SystemStats/6vRail/Active", false, PowerJNI.getUserActive6V());
117-
logger.log(now, "SystemStats/6vRail/CurrentFaults", false, PowerJNI.getUserCurrentFaults6V());
118-
119100
logger.log(
120101
now,
121102
"SystemStats/BrownoutVoltage",
@@ -124,20 +105,25 @@ private void logSystem(long now) {
124105
VOLTS_UNIT_STRING);
125106
logger.log(
126107
now, "SystemStats/CPUTempCelcius", false, PowerJNI.getCPUTemp(), CELSIUS_UNIT_STRING);
127-
}
128-
129-
private void logCan(long now) {
130-
CANJNI.getCANStatus(status);
131-
logger.log(now, "SystemStats/CANBus/Utilization", false, status.percentBusUtilization);
132-
logger.log(now, "SystemStats/CANBus/OffCount", false, status.busOffCount);
133-
logger.log(now, "SystemStats/CANBus/TxFullCount", false, status.txFullCount);
134-
logger.log(now, "SystemStats/CANBus/ReceiveErrorCount", false, status.receiveErrorCount);
135-
logger.log(now, "SystemStats/CANBus/TransmitErrorCount", false, status.transmitErrorCount);
136108

137109
logger.log(
138110
now, "SystemStats/EpochTimeMicros", false, HALUtil.getFPGATime(), MICROSECONDS_UNIT_STRING);
139111
}
140112

113+
private void logCan(long now) {
114+
for (int i = 0; i < 5; i++) {
115+
CANJNI.getCANStatus(i, status);
116+
logger.log(
117+
now, "SystemStats/CANBus/" + i + "/Utilization", false, status.percentBusUtilization);
118+
logger.log(now, "SystemStats/CANBus/" + i + "/OffCount", false, status.busOffCount);
119+
logger.log(now, "SystemStats/CANBus/" + i + "/TxFullCount", false, status.txFullCount);
120+
logger.log(
121+
now, "SystemStats/CANBus/" + i + "/ReceiveErrorCount", false, status.receiveErrorCount);
122+
logger.log(
123+
now, "SystemStats/CANBus/" + i + "/TransmitErrorCount", false, status.transmitErrorCount);
124+
}
125+
}
126+
141127
private void logPdh(long now) {
142128
if (pdh == null) {
143129
return;

lib/src/main/java/dev/doglog/internal/writers/DataLogWriter.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
package dev.doglog.internal.writers;
22

33
import dev.doglog.DogLogOptions;
4+
import edu.wpi.first.datalog.BooleanArrayLogEntry;
5+
import edu.wpi.first.datalog.BooleanLogEntry;
6+
import edu.wpi.first.datalog.DataLog;
7+
import edu.wpi.first.datalog.DataLogEntry;
8+
import edu.wpi.first.datalog.DoubleArrayLogEntry;
9+
import edu.wpi.first.datalog.DoubleLogEntry;
10+
import edu.wpi.first.datalog.FloatArrayLogEntry;
11+
import edu.wpi.first.datalog.FloatLogEntry;
12+
import edu.wpi.first.datalog.IntegerArrayLogEntry;
13+
import edu.wpi.first.datalog.IntegerLogEntry;
14+
import edu.wpi.first.datalog.StringArrayLogEntry;
15+
import edu.wpi.first.datalog.StringLogEntry;
16+
import edu.wpi.first.datalog.StructArrayLogEntry;
17+
import edu.wpi.first.datalog.StructLogEntry;
418
import edu.wpi.first.networktables.NetworkTableInstance;
5-
import edu.wpi.first.util.datalog.BooleanArrayLogEntry;
6-
import edu.wpi.first.util.datalog.BooleanLogEntry;
7-
import edu.wpi.first.util.datalog.DataLog;
8-
import edu.wpi.first.util.datalog.DataLogEntry;
9-
import edu.wpi.first.util.datalog.DoubleArrayLogEntry;
10-
import edu.wpi.first.util.datalog.DoubleLogEntry;
11-
import edu.wpi.first.util.datalog.FloatArrayLogEntry;
12-
import edu.wpi.first.util.datalog.FloatLogEntry;
13-
import edu.wpi.first.util.datalog.IntegerArrayLogEntry;
14-
import edu.wpi.first.util.datalog.IntegerLogEntry;
15-
import edu.wpi.first.util.datalog.StringArrayLogEntry;
16-
import edu.wpi.first.util.datalog.StringLogEntry;
17-
import edu.wpi.first.util.datalog.StructArrayLogEntry;
18-
import edu.wpi.first.util.datalog.StructLogEntry;
1919
import edu.wpi.first.util.struct.Struct;
2020
import edu.wpi.first.wpilibj.DataLogManager;
2121
import edu.wpi.first.wpilibj.DriverStation;

test-project/build.gradle

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id "java"
3-
id "edu.wpi.first.GradleRIO" version "2026.2.1"
3+
id "edu.wpi.first.GradleRIO2027" version "2027.0.0-alpha-1"
44
id "com.diffplug.spotless" version "8.5.1"
55
}
66

@@ -11,11 +11,11 @@ java {
1111

1212
def ROBOT_MAIN_CLASS = "frc.robot.Main"
1313

14-
// Define my targets (RoboRIO) and artifacts (deployable files)
14+
// Define my targets (SystemCore) and artifacts (deployable files)
1515
// This is added by GradleRIO's backing project DeployUtils.
1616
deploy {
1717
targets {
18-
roborio(getTargetTypeClass('RoboRIO')) {
18+
systemcore(getTargetTypeClass('SystemCore')) {
1919
// Team number is loaded either from the .wpilib/wpilib_preferences.json
2020
// or from command line. If not found an exception will be thrown.
2121
// You can use getTeamOrDefault(team) instead of getTeamNumber if you
@@ -33,16 +33,14 @@ deploy {
3333
// Static files artifact
3434
frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) {
3535
files = project.fileTree('src/main/deploy')
36-
directory = '/home/lvuser/deploy'
37-
deleteOldFiles = false // Change to true to delete files on roboRIO that no
38-
// longer exist in deploy directory of this project
36+
directory = '/home/systemcore/deploy'
3937
}
4038
}
4139
}
4240
}
4341
}
4442

45-
def deployArtifact = deploy.targets.roborio.artifacts.frcJava
43+
def deployArtifact = deploy.targets.systemcore.artifacts.frcJava
4644

4745
// Set to true to use debug for all targets including JNI, which will drastically impact
4846
// performance.
@@ -58,11 +56,11 @@ dependencies {
5856
implementation wpi.java.deps.wpilib()
5957
implementation wpi.java.vendor.java()
6058

61-
roborioDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.roborio)
62-
roborioDebug wpi.java.vendor.jniDebug(wpi.platforms.roborio)
59+
systemcoreDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.systemcore)
60+
systemcoreDebug wpi.java.vendor.jniDebug(wpi.platforms.systemcore)
6361

64-
roborioRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.roborio)
65-
roborioRelease wpi.java.vendor.jniRelease(wpi.platforms.roborio)
62+
systemcoreRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.systemcore)
63+
systemcoreRelease wpi.java.vendor.jniRelease(wpi.platforms.systemcore)
6664

6765
nativeDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.desktop)
6866
nativeDebug wpi.java.vendor.jniDebug(wpi.platforms.desktop)

test-project/gradlew

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test-project/gradlew.bat

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test-project/src/main/java/frc/robot/Robot.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@ public void autonomousInit() {
9494
}
9595

9696
@Override
97-
public void autonomousPeriodic() {
98-
DogLog.log("Units/Height6", 123, "ft");
99-
}
97+
public void autonomousPeriodic() {}
10098

10199
@Override
102100
public void autonomousExit() {}
@@ -110,9 +108,7 @@ public void teleopInit() {
110108
}
111109

112110
@Override
113-
public void teleopPeriodic() {
114-
DogLog.log("Units/Height6", 123, "meter");
115-
}
111+
public void teleopPeriodic() {}
116112

117113
@Override
118114
public void teleopExit() {}

test-project/src/main/java/frc/robot/RobotContainer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
public class RobotContainer {
1414
public RobotContainer() {
1515
DogLog.setOptions(new DogLogOptions().withCaptureDs(true));
16-
DogLog.setPdh(new PowerDistribution());
16+
DogLog.setPdh(new PowerDistribution(0));
1717

1818
configureBindings();
1919
}
2020

2121
private void configureBindings() {}
2222

2323
public Command getAutonomousCommand() {
24-
return DogLog.time("Debug/AutoCommand", Commands.waitSeconds(0.75).withName("MyAutoCommand"));
24+
return DogLog.time("Debug/AutoCommand", Commands.wait(0.75).withName("MyAutoCommand"));
2525
}
2626
}

0 commit comments

Comments
 (0)