You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@celix.apache.org by GitBox <gi...@apache.org> on 2020/04/28 19:58:16 UTC

[GitHub] [celix] pnoltes opened a new pull request #209: Feature/refactored logging service

pnoltes opened a new pull request #209:
URL: https://github.com/apache/celix/pull/209


   Refactored the logging facilities. This includes a new log service concept and logging of the framework. 
   
   Logging in Celix was IMO not very useable. The refactored implementation is inspired by the OSGi Log Service specification, but does not follow it 100%. Mainly because I think A LogFactory does not fit in a non memory managed environment. 
   
   Instead I decided to use a service on demand concept. So that bundles can request their own log services and these instances can be used the differentiate between loggers. 
   
   Also the backup logging facilities (log to stdout/stderr) foor framework logging, logging with only a log_helper and logging with a log_admin but no available log sinks is aligned using a  set of celix_logUtils functions. This in many different situatie the logging looks the same.
   
   Additionally changes: 
   - Updates the default behaviour for closing service trackers. This was done on a separately spawned thread, but because service listeners events are triggered outside of locks that is not needed anymore.
   - Fixes an issues that listener hooks where not retroactively triggered when they where added to the service registry.
   - Removes the framework cpputest + mocks. Refactoring the framework logging was near impossible with the existing mocks and because we want to move to google test I considered them deprecated. Note that we have already quite some google tests, but need to do more to increase coverage. 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [celix] pnoltes commented on pull request #209: Feature/refactored logging service

Posted by GitBox <gi...@apache.org>.
pnoltes commented on pull request #209:
URL: https://github.com/apache/celix/pull/209#issuecomment-624023501


   @abroekhuis @rlenferink ping, I would like to merge this PR. I am working on some other PR what are waiting for this one.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [celix] pnoltes commented on pull request #209: Feature/refactored logging service

Posted by GitBox <gi...@apache.org>.
pnoltes commented on pull request #209:
URL: https://github.com/apache/celix/pull/209#issuecomment-620827327


   For the added functionality (celix_log_utils.h, Celix::log_admin and the rewritten Celix::log_writer_syslog) I ensured that the coverage is 100%. 
   
   To my surprise this was reasonably achievable and hopefully something we can try to do more.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [celix] pnoltes commented on pull request #209: Feature/refactored logging service

Posted by GitBox <gi...@apache.org>.
pnoltes commented on pull request #209:
URL: https://github.com/apache/celix/pull/209#issuecomment-621405164


   > [ 21%] Building C object bundles/device_access/example/base_driver/CMakeFiles/base_driver.dir/src/activator.c.o
   > /home/oipo-unencrypted/Programming/celix-pnoltes/bundles/device_access/example/base_driver/src/activator.c: In function ‘bundleActivator_registerBaseDriverDevice’:
   > /home/oipo-unencrypted/Programming/celix-pnoltes/bundles/device_access/example/base_driver/src/activator.c:88:13: error: too many arguments to function ‘celix_strerror’
   >    88 |     serial, celix_strerror(status, error, 256));
   >       |             ^~~~~~~~~~~~~~
   > In file included from /home/oipo-unencrypted/Programming/celix-pnoltes/bundles/device_access/example/base_driver/src/activator.c:29:
   > /home/oipo-unencrypted/Programming/celix-pnoltes/libs/utils/include/celix_errno.h:62:13: note: declared here
   >    62 | const char* celix_strerror(celix_status_t status);
   >       |             ^~~~~~~~~~~~~~
   > /home/oipo-unencrypted/Programming/celix-pnoltes/bundles/device_access/example/base_driver/src/activator.c: In function ‘bundleActivator_stop’:
   > /home/oipo-unencrypted/Programming/celix-pnoltes/bundles/device_access/example/base_driver/src/activator.c:123:65: error: too many arguments to function ‘celix_strerror’
   >   123 |    fprintf(stderr, "Cannot unregister service. Got error %s\n", celix_strerror(unregStatus, error, 256));
   >       |                                                                 ^~~~~~~~~~~~~~
   > In file included from /home/oipo-unencrypted/Programming/celix-pnoltes/bundles/device_access/example/base_driver/src/activator.c:29:
   > /home/oipo-unencrypted/Programming/celix-pnoltes/libs/utils/include/celix_errno.h:62:13: note: declared here
   >    62 | const char* celix_strerror(celix_status_t status);
   >       |             ^~~~~~~~~~~~~~
   > make[2]: *** [bundles/device_access/example/base_driver/CMakeFiles/base_driver.dir/build.make:63: bundles/device_access/example/base_driver/CMakeFiles/base_driver.dir/src/activator.c.o] Error 1
   > make[1]: *** [CMakeFiles/Makefile2:2461: bundles/device_access/example/base_driver/CMakeFiles/base_driver.dir/all] Error 2
   > make: *** [Makefile:141: all] Error 2
   
   note sure why this wasn't triggered on my system (ubuntu 18), but fixed.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [celix] Oipo commented on pull request #209: Feature/refactored logging service

Posted by GitBox <gi...@apache.org>.
Oipo commented on pull request #209:
URL: https://github.com/apache/celix/pull/209#issuecomment-621317396


   ```
   [ 21%] Building C object bundles/device_access/example/base_driver/CMakeFiles/base_driver.dir/src/activator.c.o
   /home/oipo-unencrypted/Programming/celix-pnoltes/bundles/device_access/example/base_driver/src/activator.c: In function ‘bundleActivator_registerBaseDriverDevice’:
   /home/oipo-unencrypted/Programming/celix-pnoltes/bundles/device_access/example/base_driver/src/activator.c:88:13: error: too many arguments to function ‘celix_strerror’
      88 |     serial, celix_strerror(status, error, 256));
         |             ^~~~~~~~~~~~~~
   In file included from /home/oipo-unencrypted/Programming/celix-pnoltes/bundles/device_access/example/base_driver/src/activator.c:29:
   /home/oipo-unencrypted/Programming/celix-pnoltes/libs/utils/include/celix_errno.h:62:13: note: declared here
      62 | const char* celix_strerror(celix_status_t status);
         |             ^~~~~~~~~~~~~~
   /home/oipo-unencrypted/Programming/celix-pnoltes/bundles/device_access/example/base_driver/src/activator.c: In function ‘bundleActivator_stop’:
   /home/oipo-unencrypted/Programming/celix-pnoltes/bundles/device_access/example/base_driver/src/activator.c:123:65: error: too many arguments to function ‘celix_strerror’
     123 |    fprintf(stderr, "Cannot unregister service. Got error %s\n", celix_strerror(unregStatus, error, 256));
         |                                                                 ^~~~~~~~~~~~~~
   In file included from /home/oipo-unencrypted/Programming/celix-pnoltes/bundles/device_access/example/base_driver/src/activator.c:29:
   /home/oipo-unencrypted/Programming/celix-pnoltes/libs/utils/include/celix_errno.h:62:13: note: declared here
      62 | const char* celix_strerror(celix_status_t status);
         |             ^~~~~~~~~~~~~~
   make[2]: *** [bundles/device_access/example/base_driver/CMakeFiles/base_driver.dir/build.make:63: bundles/device_access/example/base_driver/CMakeFiles/base_driver.dir/src/activator.c.o] Error 1
   make[1]: *** [CMakeFiles/Makefile2:2461: bundles/device_access/example/base_driver/CMakeFiles/base_driver.dir/all] Error 2
   make: *** [Makefile:141: all] Error 2
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org