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 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 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 a DogLogOptions record class.
      Parameters:
      captureDs - the value for the captureDs record component
      logExtras - the value for the logExtras record component
      captureConsole - the value for the captureConsole record component
      ntTunables - the value for the ntTunables record component
  • Method Details

    • 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, radio connection status, etc.
      Returns:
      A new options object with logExtras set to the provided value.
    • withCaptureConsole

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

      public DogLogOptions withNtTunables(boolean ntTunables)
      Create a new options object, inheriting the configuration from this one, with ntTunables set 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 ntTunables set to the provided value.
    • withNtTunables

      public DogLogOptions withNtTunables(BooleanSupplier ntTunables)
      Create a new options object, inheriting the configuration from this one, with ntTunables set 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 ntTunables 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • 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
    • captureConsole

      public boolean captureConsole()
      Returns the value of the captureConsole record component.
      Returns:
      the value of the captureConsole record component
    • ntTunables

      public BooleanSupplier ntTunables()
      Returns the value of the ntTunables record component.
      Returns:
      the value of the ntTunables record component