Open
Conversation
added 8 commits
January 23, 2018 20:45
oldgalileo
requested changes
Feb 10, 2018
LogKitten.java
Outdated
| switch(i.getValue()) { | ||
| case "RobotModeKitten": | ||
| if(getRobotMode() == ((RobotModeKitten)i.getKey()).getMode()) { | ||
| try { |
Contributor
There was a problem hiding this comment.
There's a lot of duplicate code between "RobotModeKitten" and "CANKitten" cases. The code:
try {
if(i.getKey().output != null) {
i.getKey().output.write(content.getBytes());
} else {
System.out.println("Error logging: " + i.getKey().category + " logfile not open");
}
}
catch(IOException ioe) {
System.out.println("Error logging " + level.getName() + " message");
ioe.printStackTrace();
}
Could probably be reduced to a private method, or maybe a better flow could be worked out here.
Contributor
There was a problem hiding this comment.
Actually, it might be better instead to move the logMessage method to the Kitten class itself, and have LogKitten extend Kitten or something of that sort. Looking at a screen is making me nauseous right now but I can take a closer look tomorrow hopefully.
added 5 commits
February 9, 2018 18:25
…eam4904/standard into logkitten-improvements
…standard into logkitten-improvements
changed it from "edu.wpi.first.wpilibj.hal.HAL;" to "edu.wpi.first.hal.HAL;"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added an instantiable class to LogKitten called Kitten. Kitten can in turn be extended and logged using LogKitten to be able to classify certain errors and log them in different files. Already created and integrated classes include CANKitten for logging CAN errors and messages and RobotKitten for logging based on which robot mode. Global logging is coded into the LogKitten class. MAKE SURE YOU REVIEW THE 2018 CODE PULL REQUEST AS WELL! This new code depends on it.