Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
cp committed Sep 24, 2018
1 parent 9a580e1 commit 244bf64
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 17 deletions.
4 changes: 0 additions & 4 deletions src/main/java/com/jutils/jhttp/MyClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ public void onSuccess(Object resultValue, HttpHeaders responseHeaders, int respo
System.out.println("Result " + resultValue.toString());
}
});
Logger log = LoggerFactory.getLogger(MyClass.class);
log.debug("Hola");
log.info("Hola");
log.warn("Hola");
}

public static class NotificationData {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/jutils/jhttp/NewMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class NewMain {
public static void main(String[] args) {
// TODO code application logic here

log.debug("Hola");
log.info("Hola");

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static <T> T DeserializeObject(Class<T> clazz, String values) {
try {
result = converter.DeserializeObject(clazz, values);
} catch (Exception e) {
log.debug(TAG + " -> " + "Unable to convert data to desired class -> " + clazz.getSimpleName());
log.info(TAG + " -> " + "Unable to convert data to desired class -> " + clazz.getSimpleName());
}
return (T) result;
}
Expand All @@ -39,7 +39,7 @@ public static <T> List<T> DeserializeArray(Class<T> clazz, String values) {
try {
result = converter.DeserializeArray(clazz, values);
} catch (Exception e) {
log.debug(TAG + " -> " + "Unable to convert data to desired list of class -> " + clazz.getSimpleName());
log.info(TAG + " -> " + "Unable to convert data to desired list of class -> " + clazz.getSimpleName());
}

return (List<T>) result;
Expand All @@ -54,7 +54,7 @@ public static String Serialize(Object values) {
try {
result = converter.SerializeObject(values);
} catch (Exception e) {
log.debug(TAG + " -> " + "Unable to convert data to String");
log.info(TAG + " -> " + "Unable to convert data to String");
}
return (String) result;
}
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/com/jutils/jhttp/http/request/HttpManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ private Object service(String method, HttpResultListeners callback) {
else
callback.onSuccess(resultObject, this.ResponseHeaders, this.responseCode);
} catch (Exception e) {
log.debug(TAG + " -> " + e.getMessage());
log.info(TAG + " -> " + e.getMessage());
}
}
log.debug(TAG + " -> " + "Finalizando petición;Disconnecting Connection");
log.info(TAG + " -> " + "Finalizando petición;Disconnecting Connection");
this.httpConnection.disconnect();
return resultObject;
}
Expand All @@ -186,7 +186,7 @@ private Object MakeRequest(String method) throws Exception {
this.httpConnection.setRequestMethod(method);
this.httpConnection.setConnectTimeout(TIME_OUT);
this.httpConnection.setDoInput(true);//Permitir recepcion de datos
log.debug(TAG + " -> " + "Response Detail: URL [ " + this.url + " ] Method [ " + method + " ]\n timeout time [ "
log.info(TAG + " -> " + "Response Detail: URL [ " + this.url + " ] Method [ " + method + " ]\n timeout time [ "
+ TIME_OUT + " ] responseType [ " + this.responseClass.getSimpleName() + " ]\n ");


Expand All @@ -212,7 +212,7 @@ private Object MakeRequest(String method) throws Exception {
dos.flush();
dos.close();

log.debug(TAG + " -> " + "Content-Type [ " +
log.info(TAG + " -> " + "Content-Type [ " +
this.httpConnection.getContentType() + " ].");

}
Expand Down Expand Up @@ -258,7 +258,7 @@ private Object convertResponseToResult() throws Exception {
response.setContentType(this.httpConnection.getContentType());
result = response;

log.debug(TAG + " -> " + "Tipo de dato a retornar: Stream");
log.info(TAG + " -> " + "Tipo de dato a retornar: Stream");

} else {

Expand All @@ -272,7 +272,7 @@ private Object convertResponseToResult() throws Exception {

if (this.bReader != null) {
serverMessage = HttpManagerUtils.frombufferReader(this.bReader);
log.debug(TAG + " -> " + "Respuesta del servidor: " + serverMessage);
log.info(TAG + " -> " + "Respuesta del servidor: " + serverMessage);
//Si la peticion retornó error
if (!isSuccess) {
throw new HttpManagerInternalException(serverMessage);
Expand All @@ -285,10 +285,10 @@ private Object convertResponseToResult() throws Exception {
result = serverMessage;
} else if (this.isArrayResponse) {
result = HttpManagerConverterFactory.DeserializeArray(responseClass, serverMessage);
log.debug(TAG + " -> " + "Tipo de dato a retornar: List<" + ((Class) responseClass).getName() + ">");
log.info(TAG + " -> " + "Tipo de dato a retornar: List<" + ((Class) responseClass).getName() + ">");
} else {
result = HttpManagerConverterFactory.DeserializeObject(responseClass, serverMessage);
log.debug(TAG + " -> " + "Tipo de dato a retornar: " + ((Class) responseClass).getName());
log.info(TAG + " -> " + "Tipo de dato a retornar: " + ((Class) responseClass).getName());
}
}
}
Expand All @@ -306,7 +306,7 @@ public HttpManager setHeader(String key, String value) {
}
this.RequestHeaders.put(key, value);

log.debug(TAG + " -> " + "Agregando header: " + key + " valor:" + value);
log.info(TAG + " -> " + "Agregando header: " + key + " valor:" + value);
return this;
}

Expand Down

0 comments on commit 244bf64

Please sign in to comment.