The @ Slf4j, method is used but log does not have an info method

I have two more items on the same computer. After one item @ Slf4j, the info method cannot be clicked after log, and the other item can be pointed out normally

clipboard.png

clipboard.png

May.06,2021

  1. check to see if slf4j-api packages have been added. It is possible that your gradle or maven has been added, but has not been downloaded. Check all your libraries.
  2. check whether the import in class is mistaken. The import of slf4j should be import org.slf4j.Logger;
  3. .
  4. check to see if the version numbers of the slf4j of the two projects are the same.
  5. if everything is all right, try re-build the project, and if you are using gradle, you can try gradle cleanIdea idea. Re-force refresh all packages.

check whether the package slf4j-api has been imported. If not, take the maven project as an example

pom.xml add

<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>1.8.0-beta2</version>
</dependency>

slf4j depends on a journal library. If not, add one at will, such as logback, log4j.

.
<dependency>
    <groupId>ch.qos.logback</groupId>
    <artifactId>logback-classic</artifactId>
    <version>1.3.0-alpha4</version>
</dependency>
Menu