Record Class DogLogOptions
java.lang.Object
java.lang.Record
dev.doglog.DogLogOptions
- Record Components:
captureDs- Whether driver station data (robot enable state and joystick inputs) should be saved to the log file. Because of a limitation in WPILib, this option can't be disabled once it has been enabled.logExtras- Whether to log extra data, like PDH currents, CAN usage, etc.captureConsole- Whether console output should be saved to the log file.ntTunables- A function that returns whether tunable values from NetworkTables should be used. Best practice is to have this disabled when you are at competitions, to make robot behavior more deterministic. The default behavior is to only use tunable values from NetworkTables when not connected to the FMS on a competition field.
public record DogLogOptions(boolean captureDs, boolean logExtras, boolean captureConsole, BooleanSupplier ntTunables)
extends Record
Options for configuring DogLog.
See https://doglog.dev/reference/logger-options/ for more information.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new options object using the default options.DogLogOptions(boolean captureDs, boolean logExtras, boolean captureConsole, BooleanSupplier ntTunables) Creates an instance of aDogLogOptionsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecaptureConsolerecord component.booleanReturns the value of thecaptureDsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thelogExtrasrecord component.Returns the value of thentTunablesrecord component.final StringtoString()Returns a string representation of this record class.withCaptureConsole(boolean captureConsole) Create a new options object, inheriting the configuration from this one, withcaptureConsoleset to the provided value.withCaptureDs(boolean captureDs) Create a new options object, inheriting the configuration from this one, withcaptureDsset to the provided value.withLogExtras(boolean logExtras) Create a new options object, inheriting the configuration from this one, withlogExtrasset to the provided value.withNtTunables(boolean ntTunables) Create a new options object, inheriting the configuration from this one, withntTunablesset to the provided value.withNtTunables(BooleanSupplier ntTunables) Create a new options object, inheriting the configuration from this one, withntTunablesset to the provided value.
-
Field Details
-
LOOP_PERIOD_SECONDS
public static final double LOOP_PERIOD_SECONDS- See Also:
-
-
Constructor Details
-
DogLogOptions
public DogLogOptions()Create a new options object using the default options. The default options are safe for a competition environment, but you may want to tweak them to improve your development experience at home.See https://doglog.dev/getting-started/usage/#configuring For instructions on how to customize these options.
-
DogLogOptions
public DogLogOptions(boolean captureDs, boolean logExtras, boolean captureConsole, BooleanSupplier ntTunables) Creates an instance of aDogLogOptionsrecord class.- Parameters:
captureDs- the value for thecaptureDsrecord componentlogExtras- the value for thelogExtrasrecord componentcaptureConsole- the value for thecaptureConsolerecord componentntTunables- the value for thentTunablesrecord component
-
-
Method Details
-
withCaptureDs
Create a new options object, inheriting the configuration from this one, withcaptureDsset to the provided value.Example:
DogLog.setOptions(new DogLogOptions().withCaptureDs(true));
- Parameters:
captureDs- Whether driver station data (robot enable state and joystick inputs) should be- Returns:
- A new options object with
captureDsset to the provided value.
-
withLogExtras
Create a new options object, inheriting the configuration from this one, withlogExtrasset to the provided value.Example:
DogLog.setOptions(new DogLogOptions().withLogExtras(false));
- Parameters:
logExtras- Whether to log extra data, like PDH currents, CAN usage, radio connection status, etc.- Returns:
- A new options object with
logExtrasset to the provided value.
-
withCaptureConsole
Create a new options object, inheriting the configuration from this one, withcaptureConsoleset to the provided value.Example:
DogLog.setOptions(new DogLogOptions().withCaptureConsole(false));
- Parameters:
captureConsole- Whether console output should be saved to the log file.- Returns:
- A new options object with
captureConsoleset to the provided value.
-
withNtTunables
Create a new options object, inheriting the configuration from this one, withntTunablesset to the provided value.Example:
DogLog.setOptions(new DogLogOptions().withUseTunableValues(true));
- Parameters:
ntTunables- Whether tunable values should be read from NetworkTables.- Returns:
- A new options object with
ntTunablesset to the provided value.
-
withNtTunables
Create a new options object, inheriting the configuration from this one, withntTunablesset to the provided value.Example:
DogLog.setOptions(new DogLogOptions().withUseTunableValues(() -> true));
- Parameters:
ntTunables- A function that returns whether tunable values should be read from NetworkTables.- Returns:
- A new options object with
ntTunablesset to the provided value.
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
captureDs
-
logExtras
-
captureConsole
public boolean captureConsole()Returns the value of thecaptureConsolerecord component.- Returns:
- the value of the
captureConsolerecord component
-
ntTunables
Returns the value of thentTunablesrecord component.- Returns:
- the value of the
ntTunablesrecord component
-