Skip to content

Commit

Permalink
Do less work if result is ignored anyway
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddenalpha committed Jun 3, 2024
1 parent f0d584f commit 5c5dd9e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,15 @@ private static void logFilterResult(HttpServerRequest request, String filterProp
private static void logFilterResult(HttpServerRequest request, String filterPropertyKey, String filterPropertyValue, FilterResult filterResult, boolean noMatchingProperty){
if(FilterResult.NO_MATCH != filterResult) {
Logger log = RequestLoggerFactory.getLogger(RequestPropertyFilter.class, request);
if (!log.isInfoEnabled()) return;
StringBuilder sb = new StringBuilder("Request to ").append(request.uri());
if (noMatchingProperty) {
sb.append(" with no matching filterProperty");
} else {
sb.append(" with filterProperty ").append(filterPropertyKey).append("=").append(filterPropertyValue);
}
sb.append(" has FilterResult ").append(filterResult.name());
log.info(sb.toString());
log.info("{}", sb);
}
}
}

0 comments on commit 5c5dd9e

Please sign in to comment.