Package dev.doglog
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)
extends Record
Options for configuring DogLog.
See https://doglog.dev/reference/logger-options/ for more information.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreate a new options object using the default options.DogLogOptions
(BooleanSupplier ntPublish, boolean captureNt, boolean captureDs, boolean logExtras, boolean captureConsole, int logEntryQueueCapacity) Creates an instance of aDogLogOptions
record class. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the value of thecaptureConsole
record component.boolean
Returns the value of thecaptureDs
record component.boolean
Returns the value of thecaptureNt
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
Returns the value of thelogEntryQueueCapacity
record component.boolean
Returns the value of thelogExtras
record component.Returns the value of thentPublish
record component.final String
toString()
Returns a string representation of this record class.withCaptureConsole
(boolean captureConsole) Create a new options object, inheriting the configuration from this one, withcaptureConsole
set to the provided value.withCaptureDs
(boolean captureDs) Create a new options object, inheriting the configuration from this one, withcaptureDs
set to the provided value.withCaptureNt
(boolean captureNt) Create a new options object, inheriting the configuration from this one, withcaptureNt
set to the provided value.withLogEntryQueueCapacity
(int logEntryQueueCapacity) Create a new options object, inheriting the configuration from this one, withlogEntryQueueCapacity
set to the provided value.withLogExtras
(boolean logExtras) Create a new options object, inheriting the configuration from this one, withlogExtras
set to the provided value.withNtPublish
(boolean ntPublish) Create a new options object, inheriting the configuration from this one, withntPublish
set to the provided value.withNtPublish
(BooleanSupplier ntPublish) Create a new options object, inheriting the configuration from this one, withntPublish
set 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) Creates an instance of aDogLogOptions
record class.- Parameters:
ntPublish
- the value for thentPublish
record componentcaptureNt
- the value for thecaptureNt
record componentcaptureDs
- the value for thecaptureDs
record componentlogExtras
- the value for thelogExtras
record componentcaptureConsole
- the value for thecaptureConsole
record componentlogEntryQueueCapacity
- the value for thelogEntryQueueCapacity
record component
-
-
Method Details
-
withNtPublish
Create a new options object, inheriting the configuration from this one, withntPublish
set 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
ntPublish
set to the provided value.
-
withNtPublish
Create a new options object, inheriting the configuration from this one, withntPublish
set 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
ntPublish
set to the provided value.
-
withCaptureNt
Create a new options object, inheriting the configuration from this one, withcaptureNt
set 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
captureNt
set to the provided value.
-
withCaptureDs
Create a new options object, inheriting the configuration from this one, withcaptureDs
set 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
captureDs
set to the provided value.
-
withLogExtras
Create a new options object, inheriting the configuration from this one, withlogExtras
set 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
logExtras
set to the provided value.
-
withLogEntryQueueCapacity
Create a new options object, inheriting the configuration from this one, withlogEntryQueueCapacity
set 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
logEntryQueueCapacity
set to the provided value.
-
withCaptureConsole
Create a new options object, inheriting the configuration from this one, withcaptureConsole
set 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
captureConsole
set to the provided value.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
ntPublish
Returns the value of thentPublish
record component.- Returns:
- the value of the
ntPublish
record component
-
captureNt
public boolean captureNt()Returns the value of thecaptureNt
record component.- Returns:
- the value of the
captureNt
record component
-
captureDs
public boolean captureDs()Returns the value of thecaptureDs
record component.- Returns:
- the value of the
captureDs
record component
-
logExtras
public boolean logExtras()Returns the value of thelogExtras
record component.- Returns:
- the value of the
logExtras
record component
-
captureConsole
public boolean captureConsole()Returns the value of thecaptureConsole
record component.- Returns:
- the value of the
captureConsole
record component
-
logEntryQueueCapacity
public int logEntryQueueCapacity()Returns the value of thelogEntryQueueCapacity
record component.- Returns:
- the value of the
logEntryQueueCapacity
record component
-