I suspect there's a python mechanism to do this. The DriverStation error reporting mechanism could be used to do this.