From 244bf646f9b744f8e5995cefd5deddebd38863ac Mon Sep 17 00:00:00 2001 From: cp Date: Mon, 24 Sep 2018 00:06:19 -0500 Subject: [PATCH] --- src/main/java/com/jutils/jhttp/MyClass.java | 4 ---- src/main/java/com/jutils/jhttp/NewMain.java | 2 +- .../converter/HttpManagerConverterFactory.java | 6 +++--- .../jutils/jhttp/http/request/HttpManager.java | 18 +++++++++--------- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/jutils/jhttp/MyClass.java b/src/main/java/com/jutils/jhttp/MyClass.java index 8e4ac7c..6621cd6 100644 --- a/src/main/java/com/jutils/jhttp/MyClass.java +++ b/src/main/java/com/jutils/jhttp/MyClass.java @@ -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 { diff --git a/src/main/java/com/jutils/jhttp/NewMain.java b/src/main/java/com/jutils/jhttp/NewMain.java index 7b83b5a..4341be9 100644 --- a/src/main/java/com/jutils/jhttp/NewMain.java +++ b/src/main/java/com/jutils/jhttp/NewMain.java @@ -20,7 +20,7 @@ public class NewMain { public static void main(String[] args) { // TODO code application logic here - log.debug("Hola"); + log.info("Hola"); } diff --git a/src/main/java/com/jutils/jhttp/http/converter/HttpManagerConverterFactory.java b/src/main/java/com/jutils/jhttp/http/converter/HttpManagerConverterFactory.java index ee2bb04..e7be4a5 100644 --- a/src/main/java/com/jutils/jhttp/http/converter/HttpManagerConverterFactory.java +++ b/src/main/java/com/jutils/jhttp/http/converter/HttpManagerConverterFactory.java @@ -28,7 +28,7 @@ public static T DeserializeObject(Class 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; } @@ -39,7 +39,7 @@ public static List DeserializeArray(Class 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) result; @@ -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; } diff --git a/src/main/java/com/jutils/jhttp/http/request/HttpManager.java b/src/main/java/com/jutils/jhttp/http/request/HttpManager.java index 2f32980..a3ae3ce 100644 --- a/src/main/java/com/jutils/jhttp/http/request/HttpManager.java +++ b/src/main/java/com/jutils/jhttp/http/request/HttpManager.java @@ -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; } @@ -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 "); @@ -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() + " ]."); } @@ -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 { @@ -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); @@ -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()); } } } @@ -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; }