Skip to content

Commit

Permalink
Merge pull request #582 from hiddenalpha/DoLessWorkIfResultIsIgnoredA…
Browse files Browse the repository at this point in the history
…nyway-20240603

Don't do work where result of is thrown away anyway
  • Loading branch information
hiddenalpha authored Jun 3, 2024
2 parents f0d584f + 5c5dd9e commit 183cfb4
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 183cfb4

Please sign in to comment.