Package org.chsrobotics.lib.commands
Class LogMessageCommand
- java.lang.Object
-
- edu.wpi.first.wpilibj2.command.CommandBase
-
- org.chsrobotics.lib.commands.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.CommandBaseSimple command to log a message to the default DataLog (given byHighLevelLogger.getLog()).This command initializes and ends in the same scheduler loop.
-
-
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 voidinitialize()booleanisFinished()booleanrunsWhenDisabled()-
Methods inherited from class edu.wpi.first.wpilibj2.command.CommandBase
addRequirements, getName, getRequirements, getSubsystem, initSendable, setName, setSubsystem, withName
-
-
-
-
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.
-
-