Class HighLevelLogger


  • public class HighLevelLogger
    extends java.lang.Object
    Convenience wrapper class for telemetry/ logging with built-in logging for robot-agnostic data like environment metadata, RoboRio status, and scheduled commands.

    For the internally included loggers of system status to function, the method logPeriodic() needs to be called once per robot loop cycle.

    • Constructor Summary

      Constructors 
      Constructor Description
      HighLevelLogger()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static edu.wpi.first.util.datalog.DataLog getLog()
      Returns the DataLog populated by this, for use in more-granular and robot-specific logging.
      static void logError​(java.lang.String message)
      Writes an error, using the provided string, to the DriverStation console, and writes it to the log.
      static void logMessage​(java.lang.String message)
      Logs a String message (warning, state transition, startup information, etc.), and prints it to the standard output (DriverStation console).
      static void logPeriodic()
      Method to be called once per robot loop cycle, updating the various Loggers wrapped by this class.
      static void logWarning​(java.lang.String message)
      Writes a warning, using the provided string, to the DriverStation console, and writes it to the log.
      static void publishSendable​(java.lang.String key, edu.wpi.first.util.sendable.Sendable data)
      Publishes a Sendable object to NetworkTables.
      static void startLogging()
      Starts the HighLevelLogger.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HighLevelLogger

        public HighLevelLogger()
    • Method Detail

      • startLogging

        public static void startLogging()
        Starts the HighLevelLogger.

        Upon startup, the logger attempts to read git commit/branch data from the files in the deploy directory of the RoboRio specified in the source for this class (currently "commit.txt" and "branch.txt").

        These should be updated by the build.gradle of your functional robot code as specified by this documentation from WPI.

      • logPeriodic

        public static void logPeriodic()
        Method to be called once per robot loop cycle, updating the various Loggers wrapped by this class.
      • getLog

        public static edu.wpi.first.util.datalog.DataLog getLog()
        Returns the DataLog populated by this, for use in more-granular and robot-specific logging.
        Returns:
        The DataLog.
      • logMessage

        public static void logMessage​(java.lang.String message)
        Logs a String message (warning, state transition, startup information, etc.), and prints it to the standard output (DriverStation console).
        Parameters:
        message - The message to log.
      • logWarning

        public static void logWarning​(java.lang.String message)
        Writes a warning, using the provided string, to the DriverStation console, and writes it to the log.
        Parameters:
        message - The String message to associate with the warning.
      • logError

        public static void logError​(java.lang.String message)
        Writes an error, using the provided string, to the DriverStation console, and writes it to the log.
        Parameters:
        message - The String message to associate with the error.
      • publishSendable

        public static void publishSendable​(java.lang.String key,
                                           edu.wpi.first.util.sendable.Sendable data)
        Publishes a Sendable object to NetworkTables.
        Parameters:
        key - String key to associate with the object.
        data - Sendable object.