Skip to content

Commit

Permalink
Adding missing files
Browse files Browse the repository at this point in the history
  • Loading branch information
manumafe98 committed Feb 21, 2024
1 parent 01161d9 commit daa8d03
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package analyzer.exercises.loglevels;

import analyzer.Comment;

/**
* @see <a href="https://github.com/exercism/website-copy/blob/main/analyzer-comments/java/log-levels/avoid_using_string_format.md">Markdown Template</a>
*/
class PreferStringConcatenation extends Comment {

@Override
public String getKey() {
return "java.log-levels.prefer_string_concatenation";
}

@Override
public Type getType() {
return Type.INFORMATIVE;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"comments": [
{
"comment": "java.log-levels.use_substring_method",
"params": {},
"type": "actionable"
},
{
"comment": "java.general.feedback_request",
"params": {},
"type": "informative"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package scenarios.loglevels;

public class LogLevels {
public static String message(String logLine) {
return logLine.split("]: ")[1].trim();
}

public static String logLevel(String logLine) {
return logLine.split("]: ")[0].replace("[", "").toLowerCase();
}

public static String reformat(String logLine) {
return message(logLine) + " (" + logLevel(logLine) + ")";
}
}

0 comments on commit daa8d03

Please sign in to comment.