Rewrote System.out.print to Logger
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
package de.rwu.easydrop;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import de.rwu.easydrop.api.client.AmazonProductDataSource;
|
||||
import de.rwu.easydrop.util.ConfigUtil;
|
||||
|
||||
@@ -9,6 +12,8 @@ import de.rwu.easydrop.util.ConfigUtil;
|
||||
* @since 0.1.0
|
||||
*/
|
||||
public final class Main {
|
||||
private static final Logger logger = LoggerFactory.getLogger(Main.class);
|
||||
|
||||
/**
|
||||
* Prevents unwanted instantiation.
|
||||
*/
|
||||
@@ -24,9 +29,14 @@ public final class Main {
|
||||
public static void main(final String[] args) {
|
||||
String amznBaseUrl = ConfigUtil.getConfig("AMAZON_API_URL");
|
||||
String amznApiKey = ConfigUtil.getConfig("AMAZON_API_KEY");
|
||||
String testProduct = null;
|
||||
|
||||
AmazonProductDataSource amznSrc = new AmazonProductDataSource(amznBaseUrl, amznApiKey);
|
||||
System.out.print(amznSrc.getProductDTOById("B096Y2TYKV").toString());
|
||||
|
||||
try {
|
||||
testProduct = amznSrc.getProductDTOById("B096Y2TYKV").toString();
|
||||
logger.info(testProduct);
|
||||
} catch (IllegalArgumentException e) {
|
||||
logger.error("Something went wrong :(", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user