From 7eaf9f52b3ef3eead4695ec9ef03611b71618078 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 26 Aug 2015 10:16:22 +0200 Subject: [PATCH] Add logging to HTML filter --- src/main/java/net/pterodactylus/rhynodge/filters/HtmlFilter.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/net/pterodactylus/rhynodge/filters/HtmlFilter.java b/src/main/java/net/pterodactylus/rhynodge/filters/HtmlFilter.java index d63f563..0403b6d 100644 --- a/src/main/java/net/pterodactylus/rhynodge/filters/HtmlFilter.java +++ b/src/main/java/net/pterodactylus/rhynodge/filters/HtmlFilter.java @@ -25,6 +25,7 @@ import net.pterodactylus.rhynodge.states.FailedState; import net.pterodactylus.rhynodge.states.HtmlState; import net.pterodactylus.rhynodge.states.HttpState; +import org.apache.log4j.Logger; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; @@ -35,6 +36,8 @@ import org.jsoup.nodes.Document; */ public class HtmlFilter implements Filter { + private static final Logger logger = Logger.getLogger(HtmlFilter.class); + /** * {@inheritDoc} */ @@ -44,6 +47,7 @@ public class HtmlFilter implements Filter { return FailedState.from(state); } checkState(state instanceof HttpState, "state is not a HttpState but a %s", state.getClass().getName()); + logger.trace(String.format("Got HTML: %s, %s", ((HttpState) state).contentType(), ((HttpState) state).content())); Document document = Jsoup.parse(((HttpState) state).content(), ((HttpState) state).uri()); return new HtmlState(((HttpState) state).uri(), document); } -- 2.7.4