diff --git a/src/org/usfirst/frc/team467/robot/Logging.java b/src/org/usfirst/frc/team467/robot/Logging.java index 8b75db5..f8cb04d 100644 --- a/src/org/usfirst/frc/team467/robot/Logging.java +++ b/src/org/usfirst/frc/team467/robot/Logging.java @@ -10,6 +10,9 @@ import org.usfirst.frc.team467.robot.Autonomous.Action; import org.usfirst.frc.team467.robot.Autonomous.ActionGroup; import org.usfirst.frc.team467.robot.vision.VisionIntegration; + +import edu.wpi.first.wpilibj.DriverStation; + import org.usfirst.frc.team467.robot.Autonomous.MatchConfiguration; import org.usfirst.frc.team467.robot.simulator.DriveSimulator; import org.usfirst.frc.team467.robot.simulator.draw.RobotShape; @@ -56,8 +59,17 @@ private static void setupDefaultLogging() { System.out.println("Failed to create log file appender: " + e.getMessage()); } + try { + DriverStation station = DriverStation.getInstance(); + String event = station.getEventName(); + String type = station.getMatchType().name(); + String match = Integer.toString(station.getMatchNumber()); + Logger.getRootLogger().info(String.join(" ", event, type, match)); + } catch (NullPointerException e) { + Logger.getRootLogger().info("No match data"); + } - // Set the default log level to INFO. + // Set the default log level to ERROR. Logger.getRootLogger().setLevel(Level.ERROR); // changing log level } } \ No newline at end of file