Browse Source

Remove logging dependency (#8)

master
Taylor Bockman 7 years ago committed by GitHub
parent
commit
1df99dee80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      build.gradle
  2. 6
      src/main/java/com/sigmaflare/binancej/GeneralUtilities.java
  3. 6
      src/main/java/com/sigmaflare/binancej/MarketData.java

7
build.gradle

@ -8,7 +8,7 @@ plugins {
group = "com.sigmaflare" group = "com.sigmaflare"
archivesBaseName = "binancej" archivesBaseName = "binancej"
version = '1.0.2-SNAPSHOT' version = '1.0.3'
ext.isReleaseVersion = !version.endsWith("SNAPSHOT") ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
// Add default values for OSSRH // Add default values for OSSRH
@ -49,11 +49,6 @@ dependencies {
compile group: 'commons-io', name: 'commons-io', version: '2.6' compile group: 'commons-io', name: 'commons-io', version: '2.6'
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.5' compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.5'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.11.0'
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
testCompile group: 'org.mockito', name: 'mockito-core', version: '2.18.3' testCompile group: 'org.mockito', name: 'mockito-core', version: '2.18.3'
} }

6
src/main/java/com/sigmaflare/binancej/GeneralUtilities.java

@ -8,7 +8,6 @@ import com.sigmaflare.binancej.exceptions.BinanceServiceException;
import com.sigmaflare.binancej.exceptions.BinanceServiceUnreachableException; import com.sigmaflare.binancej.exceptions.BinanceServiceUnreachableException;
import com.sigmaflare.binancej.exceptions.UnexpectedErrorException; import com.sigmaflare.binancej.exceptions.UnexpectedErrorException;
import lombok.Builder; import lombok.Builder;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpEntity; import org.apache.http.HttpEntity;
import org.apache.http.StatusLine; import org.apache.http.StatusLine;
import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.CloseableHttpResponse;
@ -18,7 +17,6 @@ import org.apache.http.util.EntityUtils;
import java.io.IOException; import java.io.IOException;
import static com.sigmaflare.binancej.Constant.NO_RESPONSE_TEXT;
import static com.sigmaflare.binancej.Constant.NO_RESPONSE_TEXT_FORMATTED; import static com.sigmaflare.binancej.Constant.NO_RESPONSE_TEXT_FORMATTED;
import static com.sigmaflare.binancej.HttpRequests.buildGetRequestFromEndpoint; import static com.sigmaflare.binancej.HttpRequests.buildGetRequestFromEndpoint;
@ -26,7 +24,6 @@ import static com.sigmaflare.binancej.HttpRequests.buildGetRequestFromEndpoint;
* GeneralUtilities is a container class for methods that interact with the infrastructure * GeneralUtilities is a container class for methods that interact with the infrastructure
* on the Binance side. Methods like server health and exchange information are found here. * on the Binance side. Methods like server health and exchange information are found here.
*/ */
@Slf4j
public class GeneralUtilities extends BaseBinanceApi { public class GeneralUtilities extends BaseBinanceApi {
private static final String PING_URL = "/api/v1/ping"; private static final String PING_URL = "/api/v1/ping";
private static final String TIME_URL = "/api/v1/time"; private static final String TIME_URL = "/api/v1/time";
@ -63,7 +60,6 @@ public class GeneralUtilities extends BaseBinanceApi {
HttpEntity httpEntity = closeableHttpResponse.getEntity(); HttpEntity httpEntity = closeableHttpResponse.getEntity();
if (httpEntity == null) { if (httpEntity == null) {
log.error(NO_RESPONSE_TEXT, request.getURI().toASCIIString());
throw new BinanceServiceUnreachableException( throw new BinanceServiceUnreachableException(
String.format(NO_RESPONSE_TEXT_FORMATTED, request.getURI().toASCIIString()), null); String.format(NO_RESPONSE_TEXT_FORMATTED, request.getURI().toASCIIString()), null);
} }
@ -103,7 +99,6 @@ public class GeneralUtilities extends BaseBinanceApi {
HttpEntity httpEntity = closeableHttpResponse.getEntity(); HttpEntity httpEntity = closeableHttpResponse.getEntity();
if (httpEntity == null) { if (httpEntity == null) {
log.error(NO_RESPONSE_TEXT, request.getURI().toASCIIString());
throw new BinanceServiceUnreachableException( throw new BinanceServiceUnreachableException(
String.format(NO_RESPONSE_TEXT_FORMATTED, request.getURI().toASCIIString()), null); String.format(NO_RESPONSE_TEXT_FORMATTED, request.getURI().toASCIIString()), null);
} }
@ -143,7 +138,6 @@ public class GeneralUtilities extends BaseBinanceApi {
HttpEntity httpEntity = closeableHttpResponse.getEntity(); HttpEntity httpEntity = closeableHttpResponse.getEntity();
if (httpEntity == null) { if (httpEntity == null) {
log.error(NO_RESPONSE_TEXT, request.getURI().toASCIIString());
throw new BinanceServiceUnreachableException( throw new BinanceServiceUnreachableException(
String.format(NO_RESPONSE_TEXT_FORMATTED, request.getURI().toASCIIString()), null); String.format(NO_RESPONSE_TEXT_FORMATTED, request.getURI().toASCIIString()), null);
} }

6
src/main/java/com/sigmaflare/binancej/MarketData.java

@ -10,7 +10,6 @@ import com.sigmaflare.binancej.exceptions.BinanceServiceException;
import com.sigmaflare.binancej.exceptions.BinanceServiceUnreachableException; import com.sigmaflare.binancej.exceptions.BinanceServiceUnreachableException;
import com.sigmaflare.binancej.exceptions.UnexpectedErrorException; import com.sigmaflare.binancej.exceptions.UnexpectedErrorException;
import lombok.Builder; import lombok.Builder;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpEntity; import org.apache.http.HttpEntity;
import org.apache.http.StatusLine; import org.apache.http.StatusLine;
import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.CloseableHttpResponse;
@ -28,7 +27,6 @@ import static com.sigmaflare.binancej.Constant.NO_RESPONSE_TEXT_FORMATTED;
import static com.sigmaflare.binancej.Constant.SYMBOL_AND_INTERVAL_MUST_BE_SUPPLIED; import static com.sigmaflare.binancej.Constant.SYMBOL_AND_INTERVAL_MUST_BE_SUPPLIED;
import static com.sigmaflare.binancej.HttpRequests.buildGetRequestFromEndpoint; import static com.sigmaflare.binancej.HttpRequests.buildGetRequestFromEndpoint;
@Slf4j
public class MarketData extends BaseBinanceApi { public class MarketData extends BaseBinanceApi {
private static final String ORDER_BOOK_URL = "/api/v1/depth"; private static final String ORDER_BOOK_URL = "/api/v1/depth";
private static final String CANDLESTICK_URL = "/api/v1/klines"; private static final String CANDLESTICK_URL = "/api/v1/klines";
@ -95,7 +93,6 @@ public class MarketData extends BaseBinanceApi {
HttpEntity httpEntity = closeableHttpResponse.getEntity(); HttpEntity httpEntity = closeableHttpResponse.getEntity();
if (httpEntity == null) { if (httpEntity == null) {
log.error(NO_RESPONSE_TEXT, request.getURI().toASCIIString());
throw new BinanceServiceUnreachableException( throw new BinanceServiceUnreachableException(
String.format(NO_RESPONSE_TEXT_FORMATTED, request.getURI().toASCIIString()), null); String.format(NO_RESPONSE_TEXT_FORMATTED, request.getURI().toASCIIString()), null);
} }
@ -337,7 +334,6 @@ public class MarketData extends BaseBinanceApi {
HttpEntity httpEntity = closeableHttpResponse.getEntity(); HttpEntity httpEntity = closeableHttpResponse.getEntity();
if (httpEntity == null) { if (httpEntity == null) {
log.error(NO_RESPONSE_TEXT, request.getURI().toASCIIString());
throw new BinanceServiceUnreachableException( throw new BinanceServiceUnreachableException(
String.format(NO_RESPONSE_TEXT_FORMATTED, request.getURI().toASCIIString()), null); String.format(NO_RESPONSE_TEXT_FORMATTED, request.getURI().toASCIIString()), null);
} }
@ -378,7 +374,6 @@ public class MarketData extends BaseBinanceApi {
HttpEntity httpEntity = closeableHttpResponse.getEntity(); HttpEntity httpEntity = closeableHttpResponse.getEntity();
if (httpEntity == null) { if (httpEntity == null) {
log.error(NO_RESPONSE_TEXT, request.getURI().toASCIIString());
throw new BinanceServiceUnreachableException( throw new BinanceServiceUnreachableException(
String.format(NO_RESPONSE_TEXT_FORMATTED, request.getURI().toASCIIString()), null); String.format(NO_RESPONSE_TEXT_FORMATTED, request.getURI().toASCIIString()), null);
} }
@ -422,7 +417,6 @@ public class MarketData extends BaseBinanceApi {
HttpEntity httpEntity = closeableHttpResponse.getEntity(); HttpEntity httpEntity = closeableHttpResponse.getEntity();
if (httpEntity == null) { if (httpEntity == null) {
log.error(NO_RESPONSE_TEXT, request.getURI().toASCIIString());
throw new BinanceServiceUnreachableException( throw new BinanceServiceUnreachableException(
String.format(NO_RESPONSE_TEXT_FORMATTED, request.getURI().toASCIIString()), null); String.format(NO_RESPONSE_TEXT_FORMATTED, request.getURI().toASCIIString()), null);
} }

Loading…
Cancel
Save