Remove noisy logs from UrlRewriter.
UrlRewriter prints log for each URL that is rewritten, in form of
`Rewritten %s as %s`. This causes tens of long logs to be printed,
making logs very noisy.
See also
Closes
@@ -55,12 +55,10 @@ public class UrlRewriter {
private final UrlRewriterConfig config;
private final Function<URL, List<URL>> rewriter;
- private final Consumer<String> log;
@VisibleForTesting
UrlRewriter(Consumer<String> log, String filePathForErrorReporting, Reader reader)
throws UrlRewriterParseException {
- this.log = Preconditions.checkNotNull(log);
Preconditions.checkNotNull(reader, "UrlRewriterConfig source must be set");
this.config = new UrlRewriterConfig(filePathForErrorReporting, reader);
@@ -102,10 +100,6 @@ public class UrlRewriter {
ImmutableList<URL> rewritten =
urls.stream().map(rewriter).flatMap(Collection::stream).collect(toImmutableList());
- if (!urls.equals(rewritten)) {
- log.accept(String.format("Rewritten %s as %s", urls, rewritten));
- }
-
return rewritten;
}
