Skip to content

Add SN_Logging #96

@TaylerUva

Description

@TaylerUva

Add a util class called SN_Logging that will make starting logging a single line of code.

We should also begin using GVersion and Advantage Event Deploy so that we can log what code base is actually being run.

We can also log this info to SmartDashboard so we can stop asking the question "Did I deploy?"

We will need to log information from the BuildConstants.java file that gets created by GVersion. This should be automated to run once as soon as logging is started and throw and error if BuildConstants.java does not exist (With instructions on how to set up GVersion via SuperCORE instructions).

Sample code from #84

 /**
   * Starts a WPI data log. All SmartDashboard values will be in the log. In
   * simulation, log files will be saved at the given file path. Otherwise, they
   * are saved to the RIO.
   * 
   * @param filePath The filepath to save log files to in simulation. For example,
   *                 "src/main"
   */
  public static void startDataLogging(String filePath) {
    // Set out log file to be in its own folder
    if (Robot.isSimulation()) {
      DataLogManager.start(filePath);
    } else {
      DataLogManager.start();
    }
    // Log data that is being put to shuffleboard
    DataLogManager.logNetworkTables(true);
    // Log the DS data and joysticks
    DriverStation.startDataLog(DataLogManager.getLog(), true);
  }

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions