1
0
mirror of https://github.com/Snailclimb/JavaGuide synced 2025-08-14 05:21:42 +08:00

Compare commits

..

No commits in common. "35417ec719ad513c1adaded86f30dc82c580d1b5" and "681c5aeef7b66f33a79a83a943b172b2493d9ac6" have entirely different histories.

2 changed files with 3 additions and 3 deletions

View File

@ -48,7 +48,7 @@ SPI 将服务接口和具体的服务实现分离开来,将服务调用方和
## 实战演示 ## 实战演示
SLF4J Simple Logging Facade for Java是 Java 的一个日志门面(接口),其具体实现有几种比如Logback、Log4j、Log4j2 等等,而且还可以切换,在切换日志具体实现的时候我们是不需要更改项目代码的,只需要在 Maven 依赖里面修改一些 pom 依赖就好了。 Spring 框架提供的日志服务 SLF4J 其实只是一个日志门面(接口),但是 SLF4J 的具体实现可以有几种比如Logback、Log4j、Log4j2 等等,而且还可以切换,在切换日志具体实现的时候我们是不需要更改项目代码的,只需要在 Maven 依赖里面修改一些 pom 依赖就好了。
![](https://guide-blog-images.oss-cn-shenzhen.aliyuncs.com/github/javaguide/java/basis/spi/image-20220723213306039-165858318917813.png) ![](https://guide-blog-images.oss-cn-shenzhen.aliyuncs.com/github/javaguide/java/basis/spi/image-20220723213306039-165858318917813.png)

View File

@ -766,8 +766,8 @@ LocalTime.class //时间 format: HH:mm:ss
```java ```java
public void oldFormat(){ public void oldFormat(){
Date now = new Date(); Date now = new Date();
//format yyyy-MM-dd //format yyyy-MM-dd HH:mm:ss
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String date = sdf.format(now); String date = sdf.format(now);
System.out.println(String.format("date format : %s", date)); System.out.println(String.format("date format : %s", date));