Class WPILOGWriter

java.lang.Object
org.littletonrobotics.junction.wpilog.WPILOGWriter
All Implemented Interfaces:
LogDataReceiver

public class WPILOGWriter extends Object implements LogDataReceiver
Records log values to a WPILOG file.
  • Constructor Details

    • WPILOGWriter

      public WPILOGWriter(String path, WPILOGWriter.AdvantageScopeOpenBehavior openBehavior)
      Create a new WPILOGWriter for writing to a ".wpilog" file.
      Parameters:
      path - Path to log file or folder. If only a folder is provided, the filename will be generated based on the current time and match number (if applicable).
      openBehavior - Whether to automatically open the log file in AdvantageScope. See AdvantageScopeOpenBehavior for details.
    • WPILOGWriter

      public WPILOGWriter(String path)
      Create a new WPILOGWriter for writing to a ".wpilog" file.
      Parameters:
      path - Path to log file or folder. If only a folder is provided, the filename will be generated based on the current time and match number (if applicable).
    • WPILOGWriter

      public WPILOGWriter(WPILOGWriter.AdvantageScopeOpenBehavior openBehavior)
      Create a new WPILOGWriter for writing to a ".wpilog" file.

      The logs will be saved to "/U/logs" on the RIO and "logs" in sim. The filename will be generated based on the current time and match number (if applicable).

      Parameters:
      openBehavior - Whether to automatically open the log file in AdvantageScope. See AdvantageScopeOpenBehavior for details.
    • WPILOGWriter

      public WPILOGWriter()
      Create a new WPILOGWriter for writing to a ".wpilog" file.

      The logs will be saved to "/U/logs" on the RIO and "logs" in sim. The filename will be generated based on the current time and match number (if applicable).

  • Method Details

    • start

      public void start()
      Description copied from interface: LogDataReceiver
      Called before the logging system begins reporting data. This should be used to connect to files, find network devices, start threads, etc.
      Specified by:
      start in interface LogDataReceiver
    • end

      public void end()
      Description copied from interface: LogDataReceiver
      Called when the code shuts down cleanly. Note that this will NOT be called when the robot is powered off.
      Specified by:
      end in interface LogDataReceiver
    • putTable

      public void putTable(LogTable table)
      Description copied from interface: LogDataReceiver
      Called every loop cycle when a new table is complete. This data can be processed immediately or queued for later.
      Specified by:
      putTable in interface LogDataReceiver
      Parameters:
      table - A copy of the data to save.