From: David ‘Bombe’ Roden Date: Wed, 26 Aug 2015 08:16:22 +0000 (+0200) Subject: Add logging to HTML filter X-Git-Tag: v2~172 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=7eaf9f52b3ef3eead4695ec9ef03611b71618078;p=rhynodge.git Add logging to HTML filter --- 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); }