Skip to content

Logger options

By default, DogLog uses default settings that will be safe for a competition environment, but most users will want to tweak the settings to suit their team’s needs.

NetworkTables publishing

The ntPublish option controls whether logs should be published to NetworkTables.

This introduces some overhead, and can consume a lot of network bandwidth, so this option should not be used with competition flashed radios.

DogLog.setOptions(new DogLogOptions().withNtPublish(true));

Capture NetworkTables

The captureNt option controls whether all NetworkTables values should be included in logs.

This greatly increases the size of logs, and can introduce more overhead when logging.

DogLog.setOptions(new DogLogOptions().withCaptureNt(true));

Capture driver station

The captureDs option controls whether joystick data and driver station values (ex. “enabled” or “autonomous”) should be included in logs.

Due to a a limitation in WPILib’s DataLogManager, these values can’t be published over NetworkTables. Also, once enabled, this option can’t be disabled.

DogLog.setOptions(new DogLogOptions().withCaptureDs(true));

Log extras

The logExtras option controls whether “extra” data like PDH currents, CAN bus usage, battery voltage, and other system stats should be included in logs.

DogLog.setOptions(new DogLogOptions().withLogExtras(false));

Logging PDH/PDP data

When logExtras is enabled, DogLog can automatically log data from the PDP/PDH like battery voltage, device currents, etc.

To enable this, somewhere in your robot code provide a PowerDistribution instance to DogLog.setPdh():

DogLog.setPdh(new PowerDistribution());

Calling DogLog.setPdh(null) will disable PDH logging.

Log entry queue capacity

The logEntryQueueCapacity option controls the maximum number of log entries that can be queued for processing by the log thread. If the number of queued log entries exceeds this value, logs will be dropped (lost).

Decreasing this value can reduce memory usage, but may result in logs being dropped (DOG001) if the logger can’t keep up with the rate of log entries.

Increasing this value can reduce the likelihood of logs being dropped, but will increase memory usage.

You can see the number of queued logs under the Robot/DogLog/QueuedLogs log key, to get a sense of how to tune this value.

DogLog.setOptions(new DogLogOptions().withLogEntryQueueCapacity(1000));

Disabling the logger

By default, the logger is enabled. When disabled, all log calls will be ignored and nothing will be logged, which can be useful when debugging things like performance issues.

If you want to disable it, you can do so with DogLog.setEnabled():

DogLog.setEnabled(false);

And you can re-enable it with:

DogLog.setEnabled(true);