[open-ils-commits] r11557 - trunk/Open-ILS/src/c-apps

svn at svn.open-ils.org svn at svn.open-ils.org
Sun Dec 14 23:47:25 EST 2008


Author: miker
Date: 2008-12-14 23:47:23 -0500 (Sun, 14 Dec 2008)
New Revision: 11557

Modified:
   trunk/Open-ILS/src/c-apps/oils_cstore.c
Log:
yet more debugging

Modified: trunk/Open-ILS/src/c-apps/oils_cstore.c
===================================================================
--- trunk/Open-ILS/src/c-apps/oils_cstore.c	2008-12-15 04:31:50 UTC (rev 11556)
+++ trunk/Open-ILS/src/c-apps/oils_cstore.c	2008-12-15 04:47:23 UTC (rev 11557)
@@ -897,9 +897,11 @@
 
         if (param->classname) {
             pkey_value = oilsFMGetString( param, pkey );
+	        osrfLogDebug( OSRF_LOG_MARK, "Object supplied, using primary key value of %s", pkey_value );
 
         } else {
             pkey_value = jsonObjectToSimpleString( param );
+	        osrfLogDebug( OSRF_LOG_MARK, "Object not supplied, using primary key value of %s and retrieving from the database", pkey_value );
 
             jsonObject* _tmp_params = jsonParseStringFmt("{\"%s\":\"%s\"}", pkey, pkey_value);
     		jsonObject* _list = doFieldmapperSearch(
@@ -913,6 +915,7 @@
             param = jsonObjectClone(jsonObjectGetIndex(_list, 0));
     
             if (!param) {
+	            osrfLogDebug( OSRF_LOG_MARK, "Object not found in the database with primary key %s of %s", pkey, pkey_value );
                 jsonObjectFree(_tmp_params);
                 jsonObjectFree(_list);
                 return 0;
@@ -924,11 +927,12 @@
         }
 
         if (local_context->size > 0) {
+	        osrfLogDebug( OSRF_LOG_MARK, "%d class-local context field(s) specified", local_context->size);
             int i = 0;
             char* lcontext = NULL;
             while ( (lcontext = osrfStringArrayGetString(local_context, i++)) ) {
                 osrfStringArrayAdd( context_org_array, oilsFMGetString( param, lcontext ) );
-	            osrfLogDebug( OSRF_LOG_MARK, "adding %s to the context org list", osrfStringArrayGetString(context_org_array, context_org_array->size - 1) );
+	            osrfLogDebug( OSRF_LOG_MARK, "adding class-local field %s to the context org list", osrfStringArrayGetString(context_org_array, context_org_array->size - 1) );
             }
         }
 
@@ -936,6 +940,7 @@
 
         if (foreign_context) {
             class_list = osrfHashKeys( foreign_context );
+	        osrfLogDebug( OSRF_LOG_MARK, "%d foreign context classes(s) specified", class_list->size);
 
             if (class_list->size > 0) {
     
@@ -943,6 +948,8 @@
                 char* class_name = NULL;
             	while ( (class_name = osrfStringArrayGetString(class_list, i++)) ) {
                     osrfHash* fcontext = osrfHashGet(foreign_context, class_name);
+
+	                osrfLogDebug( OSRF_LOG_MARK, "%d foreign context fields(s) specified for class", (osrfStringArray*)(osrfHashGet(fcontext,"context"))->size, class_name);
     
                     jsonObject* _tmp_params = jsonParseStringFmt(
                         "{\"%s\":\"%s\"}",
@@ -988,7 +995,10 @@
     char* perm = NULL;
     int OK = 0;
 
-    if (permission->size == 0) OK = 1;
+    if (permission->size == 0) {
+	    osrfLogDebug( OSRF_LOG_MARK, "No permission specified for this action, passing through" );
+        OK = 1;
+    }
     
     int i = 0;
     while ( (perm = osrfStringArrayGetString(permission, i++)) ) {



More information about the open-ils-commits mailing list