From: kenstir Date: Wed, 18 Nov 2015 17:18:53 +0000 (-0500) Subject: * parseable Log output of OSRF gateway requests, to help me learn my way around the API X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=07b17d1e472790ec7ba9b682aa62a600602a3ba6;p=working%2FEvergreen.git * parseable Log output of OSRF gateway requests, to help me learn my way around the API --- diff --git a/Open-ILS/src/Android/opensrf/org/opensrf/net/http/GatewayRequest.java b/Open-ILS/src/Android/opensrf/org/opensrf/net/http/GatewayRequest.java index ab3594612a..61d7306baf 100644 --- a/Open-ILS/src/Android/opensrf/org/opensrf/net/http/GatewayRequest.java +++ b/Open-ILS/src/Android/opensrf/org/opensrf/net/http/GatewayRequest.java @@ -1,5 +1,7 @@ package org.opensrf.net.http; +import android.util.Log; +import org.json.JSONObject; import org.opensrf.*; import org.opensrf.util.*; @@ -22,6 +24,7 @@ import java.util.concurrent.ConcurrentLinkedQueue; public class GatewayRequest extends HttpRequest { private boolean readComplete; + private String TAG = GatewayRequest.class.getName(); public GatewayRequest(HttpConnection conn, String service, Method method) { super(conn, service, method); @@ -75,15 +78,19 @@ public class GatewayRequest extends HttpRequest { Map result = null; - System.out.println("Received " + readBuf.toString()); + //System.out.println("osrf: Received " + readBuf.toString()); + //Log.d(TAG, "received:" + readBuf.toString()); try { result = (Map) new JSONReader(readBuf.toString()).readObject(); } catch (org.opensrf.util.JSONException ex) { ex.printStackTrace(); return null; } - System.out.println("Converted object " + result); - String status = result.get("status").toString(); + //System.out.println("osrf: Converted object " + result); + Log.d(TAG, "service:" + this.service + + " method:" + this.method.getName() + + " result:" + new JSONObject(result).toString()); + String status = result.get("status").toString(); if (!"200".equals(status)) { failed = true; // failure =