Package dev.doglog

Record Class DogLogOptions

java.lang.Object
java.lang.Record
dev.doglog.DogLogOptions

public record DogLogOptions(boolean ntPublish, boolean captureNt, boolean captureDs, boolean logExtras, int logEntryQueueCapacity) extends Record
Options for configuring DogLog.

See https://doglog.dev/reference/logger-options/ for more information.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final double
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a new options object using the default options.
    DogLogOptions(boolean ntPublish, boolean captureNt, boolean captureDs, boolean logExtras, int logEntryQueueCapacity)
    Creates an instance of a DogLogOptions record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns the value of the captureDs record component.
    boolean
    Returns the value of the captureNt record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the logEntryQueueCapacity record component.
    boolean
    Returns the value of the logExtras record component.
    boolean
    Returns the value of the ntPublish record component.
    final String
    Returns a string representation of this record class.
    withCaptureDs(boolean captureDs)
    Create a new options object, inheriting the configuration from this one, with captureDs set to the provided value.
    withCaptureNt(boolean captureNt)
    Create a new options object, inheriting the configuration from this one, with captureNt set to the provided value.
    withLogEntryQueueCapacity(int logEntryQueueCapacity)
    Create a new options object, inheriting the configuration from this one, with logEntryQueueCapacity set to the provided value.
    withLogExtras(boolean logExtras)
    Create a new options object, inheriting the configuration from this one, with logExtras set to the provided value.
    withNtPublish(boolean ntPublish)
    Create a new options object, inheriting the configuration from this one, with ntPublish set to the provided value.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • DogLogOptions

      public DogLogOptions()
      Create a new options object using the default options. The default options are safe for a competition environment, but not really suited for a development environment.

      See https://doglog.dev/getting-started/usage/#configuring For instructions on how to customize these options.

    • DogLogOptions

      public DogLogOptions(boolean ntPublish, boolean captureNt, boolean captureDs, boolean logExtras, int logEntryQueueCapacity)
      Creates an instance of a DogLogOptions record class.
      Parameters:
      ntPublish - the value for the ntPublish record component
      captureNt - the value for the captureNt record component
      captureDs - the value for the captureDs record component
      logExtras - the value for the logExtras record component
      logEntryQueueCapacity - the value for the logEntryQueueCapacity record component
  • Method Details

    • withNtPublish

      public DogLogOptions withNtPublish(boolean ntPublish)
      Create a new options object, inheriting the configuration from this one, with ntPublish 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.
    • withCaptureNt

      public DogLogOptions withCaptureNt(boolean captureNt)
      Create a new options object, inheriting the configuration from this one, with captureNt 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

      public DogLogOptions withCaptureDs(boolean captureDs)
      Create a new options object, inheriting the configuration from this one, with captureDs 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

      public DogLogOptions withLogExtras(boolean logExtras)
      Create a new options object, inheriting the configuration from this one, with logExtras set to the provided value.

      Example:

      DogLog.setOptions(new DogLogOptions().withLogExtras(false));
      Parameters:
      logExtras - Whether to log extra data, like PDH currents, CAN usage, etc.
      Returns:
      A new options object with logExtras set to the provided value.
    • withLogEntryQueueCapacity

      public DogLogOptions withLogEntryQueueCapacity(int logEntryQueueCapacity)
      Create a new options object, inheriting the configuration from this one, with logEntryQueueCapacity 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.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • ntPublish

      public boolean ntPublish()
      Returns the value of the ntPublish record component.
      Returns:
      the value of the ntPublish record component
    • captureNt

      public boolean captureNt()
      Returns the value of the captureNt record component.
      Returns:
      the value of the captureNt record component
    • captureDs

      public boolean captureDs()
      Returns the value of the captureDs record component.
      Returns:
      the value of the captureDs record component
    • logExtras

      public boolean logExtras()
      Returns the value of the logExtras record component.
      Returns:
      the value of the logExtras record component
    • logEntryQueueCapacity

      public int logEntryQueueCapacity()
      Returns the value of the logEntryQueueCapacity record component.
      Returns:
      the value of the logEntryQueueCapacity record component