Skip to content
This repository was archived by the owner on May 26, 2019. It is now read-only.

Logging Standards

AMMack26 edited this page Feb 6, 2016 · 30 revisions

When to Log

  • Initialization of a Command
  • Command interruption
  • Subsystem methods
  • The execute function of a Command when it doesn't repeat
  • ?

When Not to Log

  • The execute function of a Command when it constantly repeats (Can be done temporarily for testing. Or set the repeating method at fine level.)
  • ?

How to Log

  1. Add logger to top of class file like below. Replace with the class name.
    Logger logger = Robot.getLogger(<Class>.class);
    Logger logger = Robot.getLogger(Climber.class);
  2. Use logger by calling the logger.info() or logger.fine() methods.
    • Example Initializing log statement in the initialize method of a Command:
      logger.info("[Initializing]");
    • Example Initializing log statement in the method of the Climber Subsystem. Posts what it is doing and some info on the status of the Subsystem:
      logger.fine(<Message and infor about subsystem>);
      logger.fine("Latch Released: " + "ArmLatch=" + armLatch.get());");
  3. Use appropriate log level:
    • Use logger.fine for all Subsystem classes.
    • Use logger.info for all Command classes.

Clone this wiki locally