001// Copyright (c) FIRST and other WPILib contributors.
002// Open Source Software; you can modify and/or share it under the terms of
003// the WPILib BSD license file in the root directory of this project.
004
005package edu.wpi.first.epilogue;
006
007import edu.wpi.first.epilogue.logging.EpilogueBackend;
008import edu.wpi.first.epilogue.logging.NTEpilogueBackend;
009import edu.wpi.first.epilogue.logging.errors.ErrorHandler;
010import edu.wpi.first.epilogue.logging.errors.ErrorPrinter;
011import edu.wpi.first.networktables.NetworkTableInstance;
012import edu.wpi.first.units.measure.Time;
013
014/**
015 * A configuration object to be used by the generated {@code Epilogue} class to customize its
016 * behavior.
017 */
018@SuppressWarnings("checkstyle:MemberName")
019public class EpilogueConfiguration {
020  /**
021   * The backend implementation for Epilogue to use. By default, this will log data directly to
022   * NetworkTables. NetworkTable data can be mirrored to a log file on disk by calling {@code
023   * DataLogManager.start()} in your {@code robotInit} method.
024   */
025  public EpilogueBackend backend = new NTEpilogueBackend(NetworkTableInstance.getDefault());
026
027  /**
028   * The period Epilogue will log at. By default this is the period that the robot runs at. This is
029   * the field used by bind to configure speed when adding the periodic logging function
030   */
031  public Time loggingPeriod;
032
033  /**
034   * The offset from the periodic run that Epilogue will log at. By default this will be half of the
035   * robots period. This is the field used by bind when adding the periodic logging function
036   */
037  public Time loggingPeriodOffset;
038
039  /**
040   * The minimum importance level of data to be logged. Defaults to debug, which logs data of all
041   * importance levels. Any data tagged with an importance level lower than this will not be logged.
042   */
043  public Logged.Importance minimumImportance = Logged.Importance.DEBUG;
044
045  /**
046   * The error handler for loggers to use if they encounter an error while logging. Defaults to
047   * printing an error to the standard output.
048   */
049  public ErrorHandler errorHandler = new ErrorPrinter();
050
051  /**
052   * The root identifier to use for all logged data. Defaults to "Robot", but can be changed to any
053   * string.
054   */
055  public String root = "Robot";
056
057  /** Default constructor. */
058  public EpilogueConfiguration() {}
059}