Class LogMessageCommand

  • All Implemented Interfaces:
    edu.wpi.first.util.sendable.Sendable, edu.wpi.first.wpilibj2.command.Command

    public class LogMessageCommand
    extends edu.wpi.first.wpilibj2.command.CommandBase
    Simple command to log a message to the default DataLog (given by HighLevelLogger.getLog()).

    This command initializes and ends in the same scheduler loop.

    • Field Summary

      • Fields inherited from class edu.wpi.first.wpilibj2.command.CommandBase

        m_requirements
    • Constructor Summary

      Constructors 
      Constructor Description
      LogMessageCommand​(java.lang.String message)
      Constructs a LogMessageCommand.
      LogMessageCommand​(java.util.function.Supplier<java.lang.String> messageLambda)
      Construts a LogMessageCommand.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void initialize()  
      boolean isFinished()  
      boolean runsWhenDisabled()  
      • Methods inherited from class edu.wpi.first.wpilibj2.command.CommandBase

        addRequirements, getName, getRequirements, getSubsystem, initSendable, setName, setSubsystem, withName
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface edu.wpi.first.wpilibj2.command.Command

        alongWith, andThen, andThen, asProxy, beforeStarting, beforeStarting, cancel, deadlineWith, end, execute, hasRequirement, isScheduled, perpetually, raceWith, schedule, schedule, until, withInterrupt, withTimeout
    • Constructor Detail

      • LogMessageCommand

        public LogMessageCommand​(java.util.function.Supplier<java.lang.String> messageLambda)
        Construts a LogMessageCommand. Use this when the value of the message might change from construction to command scheduling.
        Parameters:
        messageLambda - Lambda of the message to log.
      • LogMessageCommand

        public LogMessageCommand​(java.lang.String message)
        Constructs a LogMessageCommand. Use this when the value of the message won't change from construction to command scheduling.
        Parameters:
        message - The message to log.
    • Method Detail

      • runsWhenDisabled

        public boolean runsWhenDisabled()
      • initialize

        public void initialize()
      • isFinished

        public boolean isFinished()