From 22efd6cc26832d423eed8aedb3a77671c551da98 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:25:15 +0200 Subject: [PATCH] Add some logging to episode filter --- src/main/java/net/pterodactylus/rhynodge/filters/EpisodeFilter.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/net/pterodactylus/rhynodge/filters/EpisodeFilter.java b/src/main/java/net/pterodactylus/rhynodge/filters/EpisodeFilter.java index 821c1f1..9ba7cec 100644 --- a/src/main/java/net/pterodactylus/rhynodge/filters/EpisodeFilter.java +++ b/src/main/java/net/pterodactylus/rhynodge/filters/EpisodeFilter.java @@ -38,6 +38,7 @@ import com.google.common.base.Function; import com.google.common.base.Optional; import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; +import org.apache.log4j.Logger; /** * {@link Filter} implementation that extracts {@link Episode} information from @@ -47,6 +48,8 @@ import com.google.common.collect.Multimap; */ public class EpisodeFilter implements Filter { + private static final Logger logger = Logger.getLogger(EpisodeFilter.class); + /** The pattern to parse episode information from the filename. */ private static final Collection episodePatterns = asList(Pattern.compile("[Ss](\\d{2})[Ee](\\d{2})"), Pattern.compile("[^\\d](\\d{1,2})x(\\d{2})[^\\d]")); @@ -111,6 +114,7 @@ public class EpisodeFilter implements Filter { * no episode information could be found */ private static Optional extractEpisode(TorrentFile torrentFile) { + logger.debug(String.format("Extracting episode from %s...", torrentFile)); for (Pattern episodePattern : episodePatterns) { Matcher matcher = episodePattern.matcher(torrentFile.name()); if (!matcher.find() || matcher.groupCount() < 2) { @@ -118,6 +122,7 @@ public class EpisodeFilter implements Filter { } String seasonString = matcher.group(1); String episodeString = matcher.group(2); + logger.debug(String.format("Parsing %s and %s as season and episode...", seasonString, episodeString)); int season = Integer.valueOf(seasonString); int episode = Integer.valueOf(episodeString); return Optional.of(new Episode(season, episode)); -- 2.7.4