lombok不仅可以方便get,set还可以简化log日志书写
如下:
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
@Slf4j
public class LoggerTest {
// private Logger logger = LoggerFactory.getLogger(LoggerTest.class);
@Test
public void Test1(){
String name ="ddsfds";
String password ="dsfseee";
log.warn("name {}, password {}",name,password);// log中拼接变量的写法
log.info("info");
log.debug("debug");
log.error("error");
}
}