idea 开启@Slf4j 注解

pom.xml导入依赖
<dependency>
   <groupId>org.projectlombokgroupId>
   <artifactId>lombokartifactId>
dependency>
@RunWith(SpringRunner.class)
@Slf4j
public class LoggerTest {

    //private final Logger logger= LoggerFactory.getLogger(LoggerTest.class);

    @Test
    public void test1(){
        log.debug("debug...");
        log.info("info...");
        log.error("error...");
    }
}

如果 
cannot find symbol symbol  log
file ->settings ->plugins -> browse repositories ->搜索 Lompok Plugin

Cannot find symbo

你可能感兴趣的:(idea 开启@Slf4j 注解)