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.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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface edu.wpi.first.wpilibj2.command.Command
edu.wpi.first.wpilibj2.command.Command.InterruptionBehavior
-
Constructor Summary
ConstructorsConstructorDescriptionLogMessageCommand
(String message) Constructs a LogMessageCommand.LogMessageCommand
(Supplier<String> messageLambda) Construts a LogMessageCommand. -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
boolean
Methods inherited from class edu.wpi.first.wpilibj2.command.CommandBase
addRequirements, getName, getRequirements, getSubsystem, initSendable, setName, setSubsystem
Methods inherited from class java.lang.Object
equals, 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, finallyDo, getInterruptionBehavior, handleInterrupt, hasRequirement, ignoringDisable, isScheduled, perpetually, raceWith, repeatedly, schedule, unless, until, withInterrupt, withInterruptBehavior, withName, withTimeout
-
Constructor Details
-
LogMessageCommand
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
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 Details
-
runsWhenDisabled
public boolean runsWhenDisabled() -
initialize
public void initialize() -
isFinished
public boolean isFinished()
-