Improve logging for MatchesListForumUpdater

This commit is contained in:
2021-06-21 14:19:42 +02:00
parent c959d62116
commit 952f869f59
3 changed files with 7 additions and 68 deletions

View File

@@ -1,12 +1,17 @@
package de.jeyp91.tippligaforum;
import de.jeyp91.App;
import de.jeyp91.apifootball.APIFootballUpdater;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashSet;
public class MatchesListForumUpdater {
private HashSet<Integer> leagues;
private static final Logger logger = LogManager.getLogger(MatchesListForumUpdater.class);
public MatchesListForumUpdater() {
this.leagues = new APIFootballUpdater().getLeagues();
@@ -36,7 +41,8 @@ public class MatchesListForumUpdater {
rset.next();
postId = Integer.parseInt(rset.getString(1));
} catch (SQLException e) {
e.printStackTrace();
logger.error("Could not find post for " + country + " - " + league + ".");
logger.error(e.getMessage());
}
return postId;
}