Class LogUploader

java.lang.Object
com.marslib.util.LogUploader

public final class LogUploader extends Object
Utility class to automatically upload WPILog files to a GitHub repository's Releases. It avoids disrupting robot loop timings by running on a separate daemon thread.
  • Method Summary

    Modifier and Type
    Method
    Description
    static edu.wpi.first.wpilibj2.command.Command
    Generates a structural Command to physically copy any FRC internal match logs directly onto the tethered USB stick, subsequently purging the RIO to guarantee high storage overhead.
    static void
    setLogDirs(Path... dirs)
    Overrides the directories scanned for logs.
    static void
    Overrides the PAT token for testing.
    static void
    Attempts to scan for and upload log files if the cooldown has elapsed and conditions are met.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • setLogDirs

      public static void setLogDirs(Path... dirs)
      Overrides the directories scanned for logs. Used for unit testing.
    • setPatToken

      public static void setPatToken(String token)
      Overrides the PAT token for testing.
    • tryUploadLogsAsync

      public static void tryUploadLogsAsync()
      Attempts to scan for and upload log files if the cooldown has elapsed and conditions are met. This should be called from disabledPeriodic().
    • getUsbOffloadCommand

      public static edu.wpi.first.wpilibj2.command.Command getUsbOffloadCommand()
      Generates a structural Command to physically copy any FRC internal match logs directly onto the tethered USB stick, subsequently purging the RIO to guarantee high storage overhead. Useful for offline competition events where Wi-Fi upload drops entirely.