当前位置:网站首页>The successfully resolved idea cannot use the log normally after referencing Lombok's @slf4j

The successfully resolved idea cannot use the log normally after referencing Lombok's @slf4j

2022-06-26 18:42:00 JobsTribe

lombok Refer to the jar package

To be referenced in the code lombok Medium @Slf4j, Dependent dependency :

<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <version>1.18.8</version>
</dependency>

Wrong content

Code :

@Service
@Slf4j
public class AsyncServiceDemo {
    

    @Async
    public void testAsyncService(){
    
        try {
    
            Thread.sleep(10000);
        } catch (InterruptedException e) {
    
            log.error("e",e);
        }
    }
}

But write in the code log when , Has not been able to introduce :
 Insert picture description here

terms of settlement

No plug-ins downloaded Lombok

quote Lombok when , Need to have Lombok Plug in for .

stay File-Setting-Plugins-Marketplace Mid search Lombok Download it later , And then restart idea Then it can be used normally .

原网站

版权声明
本文为[JobsTribe]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/177/202206261809249721.html