Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yzfeng2020 committed Nov 19, 2024
1 parent 912046f commit 4ac91a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ final class AccessLogWriterUtil {
/**
* Writes an access log if the {@link TransientServiceOption#WITH_ACCESS_LOGGING} option is enabled
* for the {@link ServiceConfig#transientServiceOptions()} and the {@link ServiceConfig#accessLogWriter()}
* is not {@link AccessLogWriter#DISABLED} for the given {@link ServiceRequestContext#config()}.
* is not {@link AccessLogWriter#disabled()} for the given {@link ServiceRequestContext#config()}.
*/
static void maybeWriteAccessLog(ServiceRequestContext reqCtx) {
final ServiceConfig config = reqCtx.config();
Expand All @@ -45,7 +45,7 @@ static void maybeWriteAccessLog(ServiceRequestContext reqCtx) {
*
*/
private static boolean shouldWriteAccessLog(ServiceConfig config) {
return config.accessLogWriter() != AccessLogWriter.DISABLED &&
return config.accessLogWriter() != AccessLogWriter.disabled() &&
config.transientServiceOptions().contains(TransientServiceOption.WITH_ACCESS_LOGGING);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@
@FunctionalInterface
public interface AccessLogWriter {

/**
* A disabled access log writer that performs no operation.
*/
AccessLogWriter DISABLED = requestLog -> { /* No operation. */ };

/**
* Returns an access log writer with a common format.
*/
Expand All @@ -56,7 +51,7 @@ static AccessLogWriter combined() {
* Returns disabled access log writer.
*/
static AccessLogWriter disabled() {
return DISABLED;
return requestLog -> { /* No operation. */ };
}

/**
Expand Down

0 comments on commit 4ac91a4

Please sign in to comment.