celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abroekh...@apache.org
Subject svn commit: r1145046 - in /incubator/celix/trunk: log_service/private/src/log_service_impl.c log_writer/log_writer.c target.cmake whiteboard/tracker_depman/dependency_activator.c whiteboard/tracker_depman/tracker.c whiteboard/tracker_depman/tracker.h
Date Mon, 11 Jul 2011 07:11:32 GMT
Author: abroekhuis
Date: Mon Jul 11 07:11:32 2011
New Revision: 1145046

URL: http://svn.apache.org/viewvc?rev=1145046&view=rev
Log:
Updated log writer and added it to the whiteboard example.

Modified:
    incubator/celix/trunk/log_service/private/src/log_service_impl.c
    incubator/celix/trunk/log_writer/log_writer.c
    incubator/celix/trunk/target.cmake
    incubator/celix/trunk/whiteboard/tracker_depman/dependency_activator.c
    incubator/celix/trunk/whiteboard/tracker_depman/tracker.c
    incubator/celix/trunk/whiteboard/tracker_depman/tracker.h

Modified: incubator/celix/trunk/log_service/private/src/log_service_impl.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/log_service/private/src/log_service_impl.c?rev=1145046&r1=1145045&r2=1145046&view=diff
==============================================================================
--- incubator/celix/trunk/log_service/private/src/log_service_impl.c (original)
+++ incubator/celix/trunk/log_service/private/src/log_service_impl.c Mon Jul 11 07:11:32 2011
@@ -48,7 +48,6 @@ celix_status_t logService_create(log_t l
 }
 
 celix_status_t logService_log(log_service_data_t logger, log_level_t level, char * message)
{
-    printf("Logging: %s from %s\n", message, module_getSymbolicName(bundle_getCurrentModule(logger->bundle)));
     return logService_logSr(logger, NULL, level, message);
 }
 

Modified: incubator/celix/trunk/log_writer/log_writer.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/log_writer/log_writer.c?rev=1145046&r1=1145045&r2=1145046&view=diff
==============================================================================
--- incubator/celix/trunk/log_writer/log_writer.c (original)
+++ incubator/celix/trunk/log_writer/log_writer.c Mon Jul 11 07:11:32 2011
@@ -31,6 +31,8 @@
 #include "service.h"
 #include "log_writer.h"
 #include "log_listener.h"
+#include "module.h"
+#include "bundle.h"
 
 celix_status_t logWriter_create(apr_pool_t *pool, log_writer_t *writer) {
     celix_status_t status = CELIX_SUCCESS;
@@ -67,7 +69,7 @@ void service_destroy(void * userData) {
 }
 
 celix_status_t logListener_logged(log_listener_t listener, log_entry_t entry) {
-    printf("LogWriter: %s\n", entry->message);
+    printf("LogWriter: %s from %s\n", entry->message, module_getSymbolicName(bundle_getCurrentModule(entry->reference->bundle)));
 
     return CELIX_SUCCESS;
 }

Modified: incubator/celix/trunk/target.cmake
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/target.cmake?rev=1145046&r1=1145045&r2=1145046&view=diff
==============================================================================
--- incubator/celix/trunk/target.cmake (original)
+++ incubator/celix/trunk/target.cmake Mon Jul 11 07:11:32 2011
@@ -20,5 +20,5 @@
 deploy("hello_world" BUNDLES shell shell_tui hello_world celix.mongoose log_service log_writer)
 #deploy("deployer" BUNDLES shell shell_tui deployer)
 deploy("wb" BUNDLES tracker publisherA publisherB shell shell_tui)
-deploy("wb_dp" BUNDLES tracker_depman publisherA publisherB shell shell_tui log_service)
+deploy("wb_dp" BUNDLES tracker_depman publisherA publisherB shell shell_tui log_service log_writer)
 #deploy("echo" BUNDLES echo_server echo_client shell shell_tui)
\ No newline at end of file

Modified: incubator/celix/trunk/whiteboard/tracker_depman/dependency_activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/whiteboard/tracker_depman/dependency_activator.c?rev=1145046&r1=1145045&r2=1145046&view=diff
==============================================================================
--- incubator/celix/trunk/whiteboard/tracker_depman/dependency_activator.c (original)
+++ incubator/celix/trunk/whiteboard/tracker_depman/dependency_activator.c Mon Jul 11 07:11:32
2011
@@ -41,6 +41,7 @@ void * dm_create(BUNDLE_CONTEXT context)
 	data->running = false;
 	data->sender = NULL;
 	data->service = NULL;
+	data->logger = NULL;
 	return data;
 }
 

Modified: incubator/celix/trunk/whiteboard/tracker_depman/tracker.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/whiteboard/tracker_depman/tracker.c?rev=1145046&r1=1145045&r2=1145046&view=diff
==============================================================================
--- incubator/celix/trunk/whiteboard/tracker_depman/tracker.c (original)
+++ incubator/celix/trunk/whiteboard/tracker_depman/tracker.c Mon Jul 11 07:11:32 2011
@@ -40,6 +40,7 @@ void * dp_send(void * handle) {
 		for (i = 0; i < arrayList_size(data->publishers); i++) {
 			PUBLISHER_SERVICE pub = (PUBLISHER_SERVICE) arrayList_get(data->publishers, i);
 			pub->invoke(pub->publisher, "Tracker message");
+			data->logger->log(data->logger->logger, LOG_INFO, "Sending message to publisher");
 		}
 		sleep(1);
 	}
@@ -85,15 +86,21 @@ void tracker_removedServ(void * handle, 
 }
 
 void tracker_addLog(void *handle, SERVICE_REFERENCE ref, void *service) {
+    struct data * data = (struct data *) handle;
     printf("Add log\n");
+    data->logger = service;
     ((log_service_t) service)->log(((log_service_t) service)->logger, LOG_DEBUG, "test");
 }
 
 void tracker_modifiedLog(void *handle, SERVICE_REFERENCE ref, void *service) {
+    struct data * data = (struct data *) handle;
     printf("Modify log\n");
+    data->logger = service;
     ((log_service_t) service)->log(((log_service_t) service)->logger, LOG_DEBUG, "test");
 }
 
 void tracker_removeLog(void *handle, SERVICE_REFERENCE ref, void *service) {
+    struct data * data = (struct data *) handle;
+    data->logger = NULL;
     printf("Remove log\n");
 }

Modified: incubator/celix/trunk/whiteboard/tracker_depman/tracker.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/whiteboard/tracker_depman/tracker.h?rev=1145046&r1=1145045&r2=1145046&view=diff
==============================================================================
--- incubator/celix/trunk/whiteboard/tracker_depman/tracker.h (original)
+++ incubator/celix/trunk/whiteboard/tracker_depman/tracker.h Mon Jul 11 07:11:32 2011
@@ -28,6 +28,7 @@
 
 #include "headers.h"
 #include "service_component.h"
+#include "log_service.h"
 
 struct data {
 	SERVICE service;
@@ -35,6 +36,7 @@ struct data {
 	ARRAY_LIST publishers;
 	pthread_t sender;
 	bool running;
+	log_service_t logger;
 };
 
 void tracker_addedServ(void * handle, SERVICE_REFERENCE ref, void * service);



Mime
View raw message