You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public static String message(String logLine) {
int startMessageIndex = logLine.indexOf("]:") + 2;
String result = logLine.substring(startMessageIndex, logLine.length());
return result.trim();
}
public static String logLevel(String logLine) {
int startLevelIndex = logLine.indexOf("[") + 1;
int endLevelIndex = logLine.indexOf("]");
return logLine.substring(startLevelIndex, endLevelIndex).toLowerCase();
}
public static String reformat(String logLine) {
return LogLevels.message(logLine) + " (" + LogLevels.logLevel(logLine) + ")";
}
public static void result() {
String logLine = "[ERROR]: Invalid operation";
String formattedString = LogLevels.reformat(logLine);
}
}
and the suggestion is:
Consider using the substring method in result to solve this exercise. but for this exercise the substring method is implemented in the other methods, kindly review.
The text was updated successfully, but these errors were encountered:
@johanjaguardev Thanks for opening this issue! You caught a bug, you're right, the bug is being caused by the extra result method that you added, because our analyzer function checks that all method excepting reformat contain either substring or split. in this case is detecting that result does not have any of them and triggers the comment.
public class LogLevels {
}
and the suggestion is:
Consider using the substring method in result to solve this exercise. but for this exercise the substring method is implemented in the other methods, kindly review.
The text was updated successfully, but these errors were encountered: