Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getSeverity is just a pointless wrapper for ordinal #210

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions LogKitten.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public static void setPrintMute(boolean mute) {
* @param errorString
*/
private static void reportErrorToDriverStation(String details, String errorMessage, KittenLevel logLevel) {
HAL.sendError(true, logLevel.getSeverity(), false, errorMessage, details, "", false);
HAL.sendError(true, logLevel.ordinal(), false, errorMessage, details, "", false);
}

public static synchronized void logMessage(Object message, KittenLevel level, boolean override) {
Expand Down Expand Up @@ -370,15 +370,6 @@ private static synchronized String timestamp() {
public static enum KittenLevel {
// Defined in decreasing order of severity. Enum.compareTo uses the definition order to compare enum values.
WTF, FATAL, ERROR, WARN, VERBOSE, DEBUG;
/**
* Get the level severity
*
* @return the level severity as an int
*/
public int getSeverity() {
// Severity is the same as the ordinal, which increases with the order of the enum values
return ordinal();
}

/**
* Get the level name
Expand Down