Class Alert

java.lang.Object
org.wpilib.driverstation.Alert
frc.spectrumLib.telemetry.Alert
All Implemented Interfaces:
AutoCloseable

public class Alert extends Alert
A WPILib Alert that is also logged and shown on Elastic.

WPILib 2027 alpha-6 sends alerts to the Driver Station through the HAL only. They are not published to /SmartDashboard/Alerts, so Elastic's Alerts widget stays empty. There is no API to list them, so AdvantageKit's alert logger never sees them either. This subclass keeps its own registry: periodic() records the active alerts as outputs (Alerts/Errors, Alerts/Warnings, Alerts/Infos, newest first, as the 2026 dashboard showed them) and republishes them in the /SmartDashboard/Alerts group Elastic reads.

A drop-in replacement: same constructors and methods, and Alert.Level still refers to WPILib's levels.

  • Constructor Details

    • Alert

      public Alert(String text, Alert.Level level)
      Creates an alert in the default group.
      Parameters:
      text - the text shown while active
      level - its severity
    • Alert

      public Alert(String group, String text, Alert.Level level)
      Creates an alert in a named group.
      Parameters:
      group - the group (kept for WPILib compatibility; Elastic shows one list)
      text - the text shown while active
      level - its severity
  • Method Details

    • set

      public void set(boolean on)
      Overrides:
      set in class Alert
    • setText

      public void setText(String newText)
      Overrides:
      setText in class Alert
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Overrides:
      close in class Alert
    • periodic

      public static void periodic()
      Logs the active alerts and republishes them for Elastic when they change. Call every loop.