suumo-search

Perform advanced searches on Suumo.jp
git clone https://git.neuralcrash.com/suumo-search.git
Log | Files | Refs | README

commit fce717dac22fbdfc534d5359a82959c37cb97730
parent afc87ea359f4ef143fbffb2ebe4f9192750be345
Author: Kebigon <git@kebigon.xyz>
Date:   Fri, 13 Mar 2020 20:39:33 +0900

Improve logging
Diffstat:
Msrc/main/java/xyz/kebigon/housesearch/HouseSearchApplication.java | 4++++
Msrc/main/java/xyz/kebigon/housesearch/domain/SearchConditionsValidator.java | 14+++++++-------
Msrc/main/packaged-resources/cfg/log4j2.xml | 2+-
3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/src/main/java/xyz/kebigon/housesearch/HouseSearchApplication.java b/src/main/java/xyz/kebigon/housesearch/HouseSearchApplication.java @@ -72,6 +72,10 @@ public class HouseSearchApplication log.info("Email notification sent, terminating"); } + catch (final Throwable t) + { + log.error("Unrecoverable exception", t); + } finally { sentPostings.save(); diff --git a/src/main/java/xyz/kebigon/housesearch/domain/SearchConditionsValidator.java b/src/main/java/xyz/kebigon/housesearch/domain/SearchConditionsValidator.java @@ -18,14 +18,14 @@ public class SearchConditionsValidator final String url = posting.getUrl(); if (url == null) { - log.warn("Missing url for {}", posting); + log.debug("Missing url for {}", posting); return false; } final Long price = posting.getPrice(); if (price == null) { - log.warn("Missing price for {}", posting); + log.debug("Missing price for {}", posting); return false; } if (conditions.getMinPrice() != null && price < conditions.getMinPrice()) @@ -36,7 +36,7 @@ public class SearchConditionsValidator final Integer age = posting.getAge(); if (age == null) { - log.warn("Missing age for {}", posting); + log.debug("Missing age for {}", posting); return false; } if (conditions.getMinAge() != null && age < conditions.getMinAge()) @@ -47,7 +47,7 @@ public class SearchConditionsValidator final Double landSurface = posting.getLandSurface(); if (landSurface == null) { - log.warn("Missing landSurface for {}", posting); + log.debug("Missing landSurface for {}", posting); return false; } if (conditions.getMinLandSurface() != null && landSurface < conditions.getMinLandSurface()) @@ -58,7 +58,7 @@ public class SearchConditionsValidator final Double houseSurface = posting.getHouseSurface(); if (houseSurface == null) { - log.warn("Missing houseSurface for {}", posting); + log.debug("Missing houseSurface for {}", posting); return false; } if (conditions.getMinHouseSurface() != null && houseSurface < conditions.getMinHouseSurface()) @@ -69,7 +69,7 @@ public class SearchConditionsValidator final Integer walkTimeToStation = posting.getWalkTimeToStation(); if (walkTimeToStation == null) { - log.warn("Missing walkTimeToStation for {}", posting); + log.debug("Missing walkTimeToStation for {}", posting); return false; } if (conditions.getMaxWalkTimeToStation() != null && walkTimeToStation > conditions.getMaxWalkTimeToStation()) @@ -78,7 +78,7 @@ public class SearchConditionsValidator final String station = posting.getStation(); if (station == null) { - log.warn("Missing station for {}", posting); + log.debug("Missing station for {}", posting); return false; } diff --git a/src/main/packaged-resources/cfg/log4j2.xml b/src/main/packaged-resources/cfg/log4j2.xml @@ -23,7 +23,7 @@ <Logger name="com.gargoylesoftware.htmlunit" level="error" /> <Logger name="org.apache.http" level="error" /> - <Root level="trace"> + <Root level="info"> <AppenderRef ref="Console" /> <AppenderRef ref="File" /> </Root>