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 org.wpilib.epilogue;
006
007import org.wpilib.epilogue.logging.EpilogueBackend;
008import org.wpilib.epilogue.logging.NTEpilogueBackend;
009import org.wpilib.epilogue.logging.errors.ErrorHandler;
010import org.wpilib.epilogue.logging.errors.ErrorPrinter;
011import org.wpilib.networktables.NetworkTableInstance;
012import org.wpilib.units.measure.Time;
013
014/**
015 * A configuration object to be used by the generated {@code Epilogue} class to customize its
016 * behavior.
017 */
018public class EpilogueConfiguration {
019  /**
020   * The backend implementation for Epilogue to use. By default, this will log data directly to
021   * NetworkTables. NetworkTable data can be mirrored to a log file on disk by calling {@code
022   * DataLogManager.start()} in your robot class constructor.
023   */
024  public EpilogueBackend backend = new NTEpilogueBackend(NetworkTableInstance.getDefault());
025
026  /**
027   * The period Epilogue will log at. By default this is the period that the robot runs at. This is
028   * the field used by bind to configure speed when adding the periodic logging function
029   */
030  public Time loggingPeriod;
031
032  /**
033   * The offset from the periodic run that Epilogue will log at. By default this will be half of the
034   * robots period. This is the field used by bind when adding the periodic logging function
035   */
036  public Time loggingPeriodOffset;
037
038  /**
039   * The minimum importance level of data to be logged. Defaults to debug, which logs data of all
040   * importance levels. Any data tagged with an importance level lower than this will not be logged.
041   */
042  public Logged.Importance minimumImportance = Logged.Importance.DEBUG;
043
044  /**
045   * The error handler for loggers to use if they encounter an error while logging. Defaults to
046   * printing an error to the standard output.
047   */
048  public ErrorHandler errorHandler = new ErrorPrinter();
049
050  /**
051   * The root identifier to use for all logged data. Defaults to "Robot", but can be changed to any
052   * string.
053   */
054  public String root = "Robot";
055
056  /** Default constructor. */
057  public EpilogueConfiguration() {}
058}