celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpe...@apache.org
Subject svn commit: r1621914 - in /celix/trunk/remote_services: discovery_bonjour/private/src/ discovery_configured/private/src/ remote_service_admin_http/private/src/
Date Tue, 02 Sep 2014 04:53:09 GMT
Author: bpetri
Date: Tue Sep  2 04:53:09 2014
New Revision: 1621914

URL: http://svn.apache.org/r1621914
Log:
CELIX-146

replaced some more printf's with fw_log calls


Modified:
    celix/trunk/remote_services/discovery_bonjour/private/src/discovery.c
    celix/trunk/remote_services/discovery_configured/private/src/discovery.c
    celix/trunk/remote_services/discovery_configured/private/src/endpoint_descriptor_reader.c
    celix/trunk/remote_services/discovery_configured/private/src/endpoint_descriptor_writer.c
    celix/trunk/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c

Modified: celix/trunk/remote_services/discovery_bonjour/private/src/discovery.c
URL: http://svn.apache.org/viewvc/celix/trunk/remote_services/discovery_bonjour/private/src/discovery.c?rev=1621914&r1=1621913&r2=1621914&view=diff
==============================================================================
--- celix/trunk/remote_services/discovery_bonjour/private/src/discovery.c (original)
+++ celix/trunk/remote_services/discovery_bonjour/private/src/discovery.c Tue Sep  2 04:53:09
2014
@@ -41,6 +41,7 @@
 #include "service_reference.h"
 #include "service_registration.h"
 #include "remote_constants.h"
+#include "celix_log.h"
 
 #include "discovery.h"
 
@@ -256,7 +257,6 @@ celix_status_t discovery_endpointAdded(v
 
 		if (error != kDNSServiceErr_NoError) {
 			status = CELIX_ILLEGAL_STATE;
-//			printf("Registered record in dns-sd got error code %i\n", error);
 		} else {
 			//entry->txtRecord=txtRecord; TODO
 			entry->dnsServiceRef = sdRef;
@@ -352,8 +352,6 @@ celix_status_t discovery_endpointListene
 	celix_status_t status = CELIX_SUCCESS;
 	discovery_pt discovery = handle;
 
-//	printf("DISCOVERY: EndpointListener Modified - Update Scope TODO\n");
-
 	return status;
 }
 
@@ -449,7 +447,7 @@ static void discovery_resolveAddCallback
 
 	properties_pt props = properties_create();
 	int length = TXTRecordGetCount(txtLen, txtRecord);
-//	printf("Found txt record with item count %i\n|", length);
+
 	for (int i = 0; i < length; i += 1) {
 		char key[256];
 		char valueBuf[257]; //max uint8 + 1

Modified: celix/trunk/remote_services/discovery_configured/private/src/discovery.c
URL: http://svn.apache.org/viewvc/celix/trunk/remote_services/discovery_configured/private/src/discovery.c?rev=1621914&r1=1621913&r2=1621914&view=diff
==============================================================================
--- celix/trunk/remote_services/discovery_configured/private/src/discovery.c (original)
+++ celix/trunk/remote_services/discovery_configured/private/src/discovery.c Tue Sep  2 04:53:09
2014
@@ -40,6 +40,7 @@
 #include "service_reference.h"
 #include "service_registration.h"
 #include "remote_constants.h"
+#include "celix_log.h"
 
 #include "discovery.h"
 #include "endpoint_discovery_poller.h"
@@ -294,11 +295,11 @@ static celix_status_t discovery_informEn
 			if (matchResult) {
 				bundleContext_getService(discovery->context, reference, (void**) &listener);
 				if (endpointAdded) {
-					printf("DISCOVERY_CONFIGURED: Adding service (%s)\n", endpoint->service);
+					fw_log(logger, OSGI_FRAMEWORK_LOG_INFO, "DISCOVERY_CONFIGURED: Adding service (%s)",
endpoint->service);
 
 					listener->endpointAdded(listener->handle, endpoint, scope);
 				} else {
-					printf("DISCOVERY_CONFIGURED: Removing service (%s)\n", endpoint->service);
+					fw_log(logger, OSGI_FRAMEWORK_LOG_INFO, "DISCOVERY_CONFIGURED: Removing service (%s)",
endpoint->service);
 
 					listener->endpointRemoved(listener->handle, endpoint, scope);
 				}

Modified: celix/trunk/remote_services/discovery_configured/private/src/endpoint_descriptor_reader.c
URL: http://svn.apache.org/viewvc/celix/trunk/remote_services/discovery_configured/private/src/endpoint_descriptor_reader.c?rev=1621914&r1=1621913&r2=1621914&view=diff
==============================================================================
--- celix/trunk/remote_services/discovery_configured/private/src/endpoint_descriptor_reader.c
(original)
+++ celix/trunk/remote_services/discovery_configured/private/src/endpoint_descriptor_reader.c
Tue Sep  2 04:53:09 2014
@@ -331,25 +331,25 @@ int main() {
 
 	int i;
 	for (i = 0; i < arrayList_size(list); i++) {
-		printf("\nEndpoint description #%d:\n", (i+1));
+		fw_log(logger, OSGI_FRAMEWORK_LOG_DEBUG, "Endpoint description #%d:", (i+1));
 		endpoint_description_pt edp = arrayList_get(list, i);
-		printf("Id: %s\n", edp->id);
-		printf("Service Id: %ld\n", edp->serviceId);
-		printf("Framework UUID: %s\n", edp->frameworkUUID);
-		printf("Service: %s\n", edp->service);
+		fw_log(logger, OSGI_FRAMEWORK_LOG_DEBUG, "Id: %s", edp->id);
+		fw_log(logger, OSGI_FRAMEWORK_LOG_DEBUG, "Service Id: %ld", edp->serviceId);
+		fw_log(logger, OSGI_FRAMEWORK_LOG_DEBUG, "Framework UUID: %s", edp->frameworkUUID);
+		fw_log(logger, OSGI_FRAMEWORK_LOG_DEBUG, "Service: %s", edp->service);
 
 		properties_pt props = edp->properties;
 		if (props) {
-			printf("Service properties:\n");
+			fw_log(logger, OSGI_FRAMEWORK_LOG_DEBUG, "Service properties:");
 			hash_map_iterator_pt iter = hashMapIterator_create(props);
 			while (hashMapIterator_hasNext(iter)) {
 				hash_map_entry_pt entry = hashMapIterator_nextEntry(iter);
 
-				printf("- %s => '%s'\n", hashMapEntry_getKey(entry), hashMapEntry_getValue(entry));
+				fw_log(logger, OSGI_FRAMEWORK_LOG_DEBUG, "- %s => '%s'", hashMapEntry_getKey(entry),
hashMapEntry_getValue(entry));
 			}
 			hashMapIterator_destroy(iter);
 		} else {
-			printf("No service properties...\n");
+			fw_log(logger, OSGI_FRAMEWORK_LOG_DEBUG, "No service properties.");
 		}
 
 

Modified: celix/trunk/remote_services/discovery_configured/private/src/endpoint_descriptor_writer.c
URL: http://svn.apache.org/viewvc/celix/trunk/remote_services/discovery_configured/private/src/endpoint_descriptor_writer.c?rev=1621914&r1=1621913&r2=1621914&view=diff
==============================================================================
--- celix/trunk/remote_services/discovery_configured/private/src/endpoint_descriptor_writer.c
(original)
+++ celix/trunk/remote_services/discovery_configured/private/src/endpoint_descriptor_writer.c
Tue Sep  2 04:53:09 2014
@@ -227,6 +227,6 @@ int main() {
     endpointDescription_destroy(epd2);
     endpointDescriptorWriter_destroy(writer);
 
-    printf("%s\n", buffer);
+    fw_log(logger, OSGI_FRAMEWORK_LOG_DEBUG, "%s", buffer);
 }
 #endif

Modified: celix/trunk/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c
URL: http://svn.apache.org/viewvc/celix/trunk/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c?rev=1621914&r1=1621913&r2=1621914&view=diff
==============================================================================
--- celix/trunk/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c
(original)
+++ celix/trunk/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c
Tue Sep  2 04:53:09 2014
@@ -43,6 +43,7 @@
 #include "bundle.h"
 #include "service_reference.h"
 #include "service_registration.h"
+#include "celix_log.h"
 
 struct post {
     const char *readptr;
@@ -95,7 +96,7 @@ celix_status_t remoteServiceAdmin_create
 		} else {
 			(*admin)->port = apr_pstrdup(pool, port);
 		}
-		printf("Start webserver: %s\n", (*admin)->port);
+		fw_log(logger, OSGI_FRAMEWORK_LOG_INFO, "RSA: Start webserver: %s", (*admin)->port);
 		const char *options[] = { "listening_ports", (*admin)->port, NULL};
 
 		// Prepare callbacks structure. We have only one callback, the rest are NULL.
@@ -104,7 +105,7 @@ celix_status_t remoteServiceAdmin_create
 		callbacks.begin_request = remoteServiceAdmin_callback;
 
 		(*admin)->ctx = mg_start(&callbacks, (*admin), options);
-		printf("Start webserver %p\n", (*admin)->ctx);
+		fw_log(logger, OSGI_FRAMEWORK_LOG_DEBUG, "RSA: Start webserver %p", (*admin)->ctx);
 	}
 
 	return status;
@@ -248,7 +249,7 @@ celix_status_t remoteServiceAdmin_export
     }
 
 	if (reference == NULL) {
-		printf("ERROR: expected a reference for service id %s\n", serviceId);
+		fw_log(logger, OSGI_FRAMEWORK_LOG_ERROR, "ERROR: expected a reference for service id %s.",
serviceId);
 		return CELIX_ILLEGAL_STATE;
 	}
 
@@ -260,9 +261,9 @@ celix_status_t remoteServiceAdmin_export
 	char *provided = properties_get(serviceProperties, (char *) OSGI_FRAMEWORK_OBJECTCLASS);
 
 	if (exports == NULL || provided == NULL) {
-		printf("RSA: No Services to export.\n");
+		fw_log(logger, OSGI_FRAMEWORK_LOG_WARNING, "RSA: No Services to export.");
 	} else {
-		printf("RSA: Export services (%s)\n", exports);
+		fw_log(logger, OSGI_FRAMEWORK_LOG_INFO, "RSA: Export services (%s)", exports);
 		array_list_pt interfaces = NULL;
 		arrayList_create(&interfaces);
 		if (strcmp(utils_stringTrim(exports), "*") == 0) {
@@ -437,7 +438,7 @@ celix_status_t remoteServiceAdmin_getImp
 celix_status_t remoteServiceAdmin_importService(remote_service_admin_pt admin, endpoint_description_pt
endpointDescription, import_registration_pt *registration) {
 	celix_status_t status = CELIX_SUCCESS;
 
-	printf("RSA: Import service %s\n", endpointDescription->service);
+	fw_log(logger, OSGI_FRAMEWORK_LOG_INFO, "RSA: Import service %s", endpointDescription->service);
 
    import_registration_factory_pt registration_factory = (import_registration_factory_pt)
hashMap_get(admin->importedServices, endpointDescription->service);
 
@@ -451,7 +452,7 @@ celix_status_t remoteServiceAdmin_import
 	 // factory available
 	if (status != CELIX_SUCCESS || (registration_factory->trackedFactory == NULL))
 	{
-		printf("RSA: no proxyFactory available.\n");
+		fw_log(logger, OSGI_FRAMEWORK_LOG_WARNING, "RSA: no proxyFactory available.");
 	}
 	else
 	{
@@ -474,7 +475,7 @@ celix_status_t remoteServiceAdmin_remove
     // factory available
     if ((registration_factory == NULL) || (registration_factory->trackedFactory == NULL))
     {
-    	printf("RSA: Error while retrieving registration factory for imported service %s\n",
endpointDescription->service);
+    	fw_log(logger, OSGI_FRAMEWORK_LOG_ERROR, "RSA: Error while retrieving registration factory
for imported service %s", endpointDescription->service);
     }
     else
     {
@@ -484,7 +485,7 @@ celix_status_t remoteServiceAdmin_remove
 
 		if (arrayList_isEmpty(registration_factory->registrations))
 		{
-			printf("RSA: closing proxy\n");
+			fw_log(logger, OSGI_FRAMEWORK_LOG_INFO, "RSA: closing proxy");
 
 			serviceTracker_close(registration_factory->proxyFactoryTracker);
 			importRegistrationFactory_close(registration_factory);
@@ -556,7 +557,7 @@ static size_t remoteServiceAdmin_write(v
   mem->writeptr = realloc(mem->writeptr, mem->size + realsize + 1);
   if (mem->writeptr == NULL) {
     /* out of memory! */
-    printf("not enough memory (realloc returned NULL)\n");
+	  fw_log(logger, OSGI_FRAMEWORK_LOG_ERROR, "not enough memory (realloc returned NULL)");
     exit(EXIT_FAILURE);
   }
 



Mime
View raw message