diff options
author | Alexander Alexeev | 2016-11-10 04:50:07 +0700 |
---|---|---|
committer | Vitaly Takmazov | 2016-11-10 21:41:14 +0300 |
commit | 09221ab5695e99b2df1130ea923c39625ec85429 (patch) | |
tree | 58c775188d25239a1e32a83f8007e5f1679d49ee /juick-www/src/main/java/ru/sape/SapeConnection.java | |
parent | 705d4f87c97dfa20eb6daa88b93ff124fa401b92 (diff) |
using slf4j + logback for logging
Diffstat (limited to 'juick-www/src/main/java/ru/sape/SapeConnection.java')
-rw-r--r-- | juick-www/src/main/java/ru/sape/SapeConnection.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/juick-www/src/main/java/ru/sape/SapeConnection.java b/juick-www/src/main/java/ru/sape/SapeConnection.java index 99a89302..5c2e3397 100644 --- a/juick-www/src/main/java/ru/sape/SapeConnection.java +++ b/juick-www/src/main/java/ru/sape/SapeConnection.java @@ -1,6 +1,8 @@ package ru.sape; import com.github.ooxi.phparser.SerializedPhpParser; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.BufferedReader; import java.io.IOException; @@ -10,11 +12,9 @@ import java.io.StringWriter; import java.net.HttpURLConnection; import java.net.URL; import java.util.*; -import java.util.logging.Level; -import java.util.logging.Logger; public class SapeConnection { - private static final Logger logger = Logger.getLogger(SapeConnection.class.getName()); + private static final Logger logger = LoggerFactory.getLogger(SapeConnection.class); private final String version = "1.0.3"; private final List<String> serverList = Arrays.asList("dispenser-01.sape.ru", "dispenser-02.sape.ru"); private final String dispenserPath; @@ -81,7 +81,7 @@ public class SapeConnection { } if (data.startsWith("FATAL ERROR:")) { - logger.log(Level.SEVERE, "Sape responded with error: " + data); + logger.error("Sape responded with error: " + data); continue; } @@ -89,7 +89,7 @@ public class SapeConnection { try { cached = (Map<String, Object>) new SerializedPhpParser(data).parse(); } catch (Exception e) { - logger.log(Level.SEVERE, "Can't parse Sape data", e); + logger.error("Can't parse Sape data", e); continue; } @@ -98,7 +98,7 @@ public class SapeConnection { return cached; } - logger.log(Level.SEVERE, "Unable to fetch Sape data"); + logger.error("Unable to fetch Sape data"); return Collections.emptyMap(); } |