Class Telemetry

java.lang.Object
dev.doglog.DogLog
frc.spectrumLib.telemetry.Telemetry
All Implemented Interfaces:
Subsystem

public class Telemetry extends DogLog implements Subsystem
Telemetry and logging utility. Extends DogLog to provide structured logging and console output with priority levels.
  • Constructor Details

    • Telemetry

      public Telemetry()
      Creates a Telemetry instance and registers it as a WPILib subsystem so its periodic() method is called every loop cycle.
  • Method Details

    • periodic

      public void periodic()
      Called every robot loop cycle. Logs any newly active alerts from NetworkTables.
      Specified by:
      periodic in interface Subsystem
    • start

      public static void start(boolean ntPublish, boolean captureDs, boolean captureNt, boolean captureConsole, boolean logExtras, boolean tunableOnFMS, Telemetry.PrintPriority priority)
      Start the telemetry system.
      Parameters:
      ntPublish - Whether to publish to NetworkTables.
      captureNt - Whether to capture NetworkTables entries in the log.
      captureDs - Whether to capture SmartDashboard entries in the log.
      captureConsole - Whether to capture console output in the log.
      logExtras - Whether to log extra data, like PDH currents, CAN usage, radio connection status, etc.
      tunableOnFMS - Whether tunable values should be read from NetworkTables.
      priority - The minimum priority level for console output.
    • log

      public static Command log(Command cmd)
      Wraps a command so that its initialization and end are logged to the "Commands" key.
      Parameters:
      cmd - The command to wrap
      Returns:
      a decorated command that logs lifecycle events and preserves the original name
    • print

      public static void print(String output, Telemetry.PrintPriority priority)
      Print a statement if they are enabled
    • print

      public static void print(String output)
      Prints a message at Telemetry.PrintPriority.NORMAL priority. The message is always written to the DogLog "Prints" key but only echoed to stdout when the global priority allows it.
      Parameters:
      output - The string to print
    • logAlerts

      public static void logAlerts()
      Reads all active alerts from the SmartDashboard NetworkTable and logs any that are new since the last call under the "Alerts" DogLog key.