Record Class DogLogOptions
java.lang.Object
java.lang.Record
dev.doglog.DogLogOptions
public record DogLogOptions(BooleanSupplier ntPublish, boolean captureNt, boolean captureDs, boolean logExtras, boolean captureConsole, int logEntryQueueCapacity, BooleanSupplier ntTunables, boolean useLogThread)
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(BooleanSupplier ntPublish, boolean captureNt, boolean captureDs, boolean logExtras, boolean captureConsole, int logEntryQueueCapacity, BooleanSupplier ntTunables, boolean useLogThread) Creates an instance of aDogLogOptionsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecaptureConsolerecord component.booleanReturns the value of thecaptureDsrecord component.booleanReturns the value of thecaptureNtrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thelogEntryQueueCapacityrecord component.booleanReturns the value of thelogExtrasrecord component.Returns the value of thentPublishrecord component.Returns the value of thentTunablesrecord component.final StringtoString()Returns a string representation of this record class.booleanReturns the value of theuseLogThreadrecord component.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.withCaptureNt(boolean captureNt) Create a new options object, inheriting the configuration from this one, withcaptureNtset to the provided value.withLogEntryQueueCapacity(int logEntryQueueCapacity) Create a new options object, inheriting the configuration from this one, withlogEntryQueueCapacityset to the provided value.withLogExtras(boolean logExtras) Create a new options object, inheriting the configuration from this one, withlogExtrasset to the provided value.withNtPublish(boolean ntPublish) Create a new options object, inheriting the configuration from this one, withntPublishset to the provided value.withNtPublish(BooleanSupplier ntPublish) Create a new options object, inheriting the configuration from this one, withntPublishset 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.withUseLogThread(boolean useLogThread) Create a new options object, inheriting the configuration from this one, withuseLogThreadset 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(BooleanSupplier ntPublish, boolean captureNt, boolean captureDs, boolean logExtras, boolean captureConsole, int logEntryQueueCapacity, BooleanSupplier ntTunables, boolean useLogThread) Creates an instance of aDogLogOptionsrecord class.- Parameters:
ntPublish- the value for thentPublishrecord componentcaptureNt- the value for thecaptureNtrecord componentcaptureDs- the value for thecaptureDsrecord componentlogExtras- the value for thelogExtrasrecord componentcaptureConsole- the value for thecaptureConsolerecord componentlogEntryQueueCapacity- the value for thelogEntryQueueCapacityrecord componentntTunables- the value for thentTunablesrecord componentuseLogThread- the value for theuseLogThreadrecord component
-
-
Method Details
-
withNtPublish
Create a new options object, inheriting the configuration from this one, withntPublishset to the provided value.Example:
DogLog.setOptions(new DogLogOptions().withNtPublish(true));
- Parameters:
ntPublish- Whether logged values should be published to NetworkTables.- Returns:
- A new options object with
ntPublishset to the provided value.
-
withNtPublish
Create a new options object, inheriting the configuration from this one, withntPublishset to the provided value.Example:
DogLog.setOptions(new DogLogOptions().withNtPublish(() -> true));
- Parameters:
ntPublish- A function that returns whether logged values should be published to NetworkTables.- Returns:
- A new options object with
ntPublishset to the provided value.
-
withCaptureNt
Create a new options object, inheriting the configuration from this one, withcaptureNtset to the provided value.Example:
DogLog.setOptions(new DogLogOptions().withCaptureNt(true));
- Parameters:
captureNt- Whether all NetworkTables fields should be saved to the log file.- Returns:
- A new options object with
captureNtset to the provided value.
-
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.
-
withLogEntryQueueCapacity
Create a new options object, inheriting the configuration from this one, withlogEntryQueueCapacityset to the provided value.Example:
DogLog.setOptions(new DogLogOptions().withLogEntryQueueCapacity(1000));
- Parameters:
logEntryQueueCapacity- The size of the log message queue to use.- Returns:
- A new options object with
logEntryQueueCapacityset 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.
-
withUseLogThread
Create a new options object, inheriting the configuration from this one, withuseLogThreadset to the provided value.- Parameters:
useLogThread- Whether to use a separate thread to handle log entries.- Returns:
- A new options object with
useLogThreadset 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. -
ntPublish
Returns the value of thentPublishrecord component.- Returns:
- the value of the
ntPublishrecord component
-
captureNt
public boolean captureNt()Returns the value of thecaptureNtrecord component.- Returns:
- the value of the
captureNtrecord component
-
captureDs
public boolean captureDs()Returns the value of thecaptureDsrecord component.- Returns:
- the value of the
captureDsrecord component
-
logExtras
public boolean logExtras()Returns the value of thelogExtrasrecord component.- Returns:
- the value of the
logExtrasrecord component
-
captureConsole
public boolean captureConsole()Returns the value of thecaptureConsolerecord component.- Returns:
- the value of the
captureConsolerecord component
-
logEntryQueueCapacity
public int logEntryQueueCapacity()Returns the value of thelogEntryQueueCapacityrecord component.- Returns:
- the value of the
logEntryQueueCapacityrecord component
-
ntTunables
Returns the value of thentTunablesrecord component.- Returns:
- the value of the
ntTunablesrecord component
-
useLogThread
public boolean useLogThread()Returns the value of theuseLogThreadrecord component.- Returns:
- the value of the
useLogThreadrecord component
-