Skip to content

Commit

Permalink
Fixed the bug that logStrategy=NONE will still print a blank line of …
Browse files Browse the repository at this point in the history
…logs
  • Loading branch information
tm.chen committed Jun 1, 2024
1 parent 0335ad9 commit 541777f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ gitee项目地址:[https://gitee.com/lianjiatech/retrofit-spring-boot-starter]
<dependency>
<groupId>com.github.lianjiatech</groupId>
<artifactId>retrofit-spring-boot-starter</artifactId>
<version>3.1.0</version>
<version>3.1.1</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<dependency>
<groupId>com.github.lianjiatech</groupId>
<artifactId>retrofit-spring-boot-starter</artifactId>
<version>3.1.0</version>
<version>3.1.1</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.github.lianjiatech</groupId>
<artifactId>retrofit-spring-boot-starter</artifactId>
<version>3.1.0</version>
<version>3.1.1</version>

<name>retrofit-spring-boot-starter</name>
<description>retrofit-spring-boot-starter</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ public Response intercept(Chain chain) throws IOException {
if (!needLog(logging)) {
return chain.proceed(chain.request());
}
LogLevel logLevel = logging == null ? globalLogProperty.getLogLevel() : logging.logLevel();
LogStrategy logStrategy = logging == null ? globalLogProperty.getLogStrategy() : logging.logStrategy();
if (logStrategy == LogStrategy.NONE) {
return chain.proceed(chain.request());
}
LogLevel logLevel = logging == null ? globalLogProperty.getLogLevel() : logging.logLevel();
boolean aggregate = logging == null ? globalLogProperty.isAggregate() : logging.aggregate();
HttpLoggingInterceptor.Logger matchLogger = matchLogger(logLevel);
HttpLoggingInterceptor.Logger logger = aggregate ? new BufferingLogger(matchLogger) : matchLogger;
Expand Down

0 comments on commit 541777f

Please sign in to comment.