Configuring DogLog
By default, DogLog uses a settings configuration that will be safe for a competition environment, but most teams will want to tweak the settings to suit their needs.
Logger options
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.
By default, DogLog will publish to NetworkTables unless the robot connects to the FMS on a competition field.
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.
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.
Log extras
The logExtras
option controls whether “extra” data like PDH currents, CAN bus usage, battery voltage, radio connection status, and other system stats should be included in logs.
Capturing console output
The captureConsole
option controls whether console output (from /home/lvuser/FRC_UserProgram.log
) should be included in logs.
Due to a a limitation in WPILib’s DataLogManager
, these values can’t be published over NetworkTables.
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 (MAX_QUEUED_LOGS
) 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.
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()
:
Calling DogLog.setPdh(null)
will disable PDH logging.
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()
:
And you can re-enable it with: