Class Alert
java.lang.Object
org.wpilib.driverstation.Alert
frc.spectrumLib.telemetry.Alert
- All Implemented Interfaces:
AutoCloseable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class Alert
Alert.Level -
Constructor Summary
ConstructorsConstructorDescriptionAlert(String group, String text, Alert.Level level) Creates an alert in a named group.Alert(String text, Alert.Level level) Creates an alert in the default group. -
Method Summary
-
Constructor Details
-
Alert
Creates an alert in the default group.- Parameters:
text- the text shown while activelevel- its severity
-
Alert
Creates an alert in a named group.- Parameters:
group- the group (kept for WPILib compatibility; Elastic shows one list)text- the text shown while activelevel- its severity
-
-
Method Details
-
set
-
setText
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classAlert
-
periodic
public static void periodic()Logs the active alerts and republishes them for Elastic when they change. Call every loop.
-