Logs logs logs - java - enums

In the instruction it is mentioning a LogLine class , but there is no LogLine class in code editor. And when i create a new LogLine class it is showing error. How do i solve the first task?

What is your code? What is the error? Please use codeblocks. Do not use screenshots/images.

public enum LogLevel {
    TRACE,
    DEBUG,
    INFO,
    WARNING,
    ERROR,
    FATAL,
    UNKNOWN;

    
}

class LogLine {
    private String logLine;
    LogLine(String logLine) {
        this.logLine = this.logLine;
    }
    public static LogLevel getLogLevel() {
        switch (this.logLine.split(":")[0]) {
            case "[TRC]": return LogLevel.TRACE;
            case "[DBG]": return LogLevel.DEBUG;
            case "[INF]": return LogLevel.INFO;
            case "[WRN]": return LogLevel.WARNING;
            case "[ERR]": return LogLevel.ERROR;
            case "[FTL]": return LogLevel.FATAL;
            default: return LogLevel.UNKNOWN;
        }
    }
}
this is the code i typed for the first task, which is parsing the log level

And what is the test error?

./src/main/java/LogLevel.java:10: error: cannot find symbol
        switch (this.logLine.split(":")[0]) {
                    ^
  symbol: variable logLine./src/main/java/LogLevel.java:17: error: cannot find symbol
            default: return LogLevel.UNKNOWN;
                                    ^
  symbol:   variable UNKNOWN
  location: class LogLevel

This is the function signature you are given.

    public static String logLevel(String logLine) {

The signature should not be changed. The function should return a String.

I changed return statement to String type. still getting duplicate class error

./src/main/java/LogLevel.java:13: error: duplicate class: LogLine
class LogLine {
^

The task is to implement LogLine.getLogLevel() method.
But there is no LogLine class defined in the editor, so i created a LogLine class myself.

The instructions say,

  1. Get log level from a log line
    Implement the (static) LogLevels.logLevel() method to return a log line’s log level, which should be returned in lowercase:

Those are different class names.

Got it. I did not noticed the second file in the code editor.
Thank You. :slightly_smiling_face:

Awesome. You’re very welcome. Did you get all the tests to pass, i.e. is this completed resolved?