Hi Alexander,
I agree, I had always the impression that the fw_log is using the logservice.
But nevertheless wouldn't it be useful to have a re-usable code part which
takes care of register/unregistering the log service and also implement a
fallback-printf?
Otherwise we end up with plenty of boilerplate-code only for doing "some" logs.
Regards,
Björn
Sent with AquaMail for Android
http://www.aqua-mail.com
On September 25, 2014 7:30:05 AM Alexander Broekhuis
<[email protected]> wrote:
Hi Bjorn,
I've noticed it before, but never realized this...
You are using the framework logger for the logging from bundles. I remember
an earlier discussion where you asked why the log_service is not used. I
now get why that question popped up.
So imho, the framework logger should only be used for the framework itself,
since wrt startup, locking etc, a log_service might not be available or
usable. Also, any other relevant framework action is published using an
event, which are picked up by the log_service.
But in any other bundle, the log bundle can/should be used. Whether this
should be an optional dependency or not is something that can be debated.
So instead of using fw_log in places like this, a dependency to the
log_service is needed, and logging must be done via the log_service.
Ps: it might be a good idea to setup something about symbol visibility.
Most needed framework methods already have the correct annotations for
this, so it should mostly be a matter of enabling it in the build. This
does prevent leakage of those framework private methods, at least at
runtime.
2014-09-25 6:38 GMT+02:00 <[email protected]>:
> Author: bpetri
> Date: Thu Sep 25 04:38:53 2014
> New Revision: 1627453
>
> URL: http://svn.apache.org/r1627453
> Log:
>
> fix loglevel
>
>
> Modified:
> celix/trunk/remote_services/topology_manager/private/src/activator.c
>
> Modified:
> celix/trunk/remote_services/topology_manager/private/src/activator.c
> URL:
>
http://svn.apache.org/viewvc/celix/trunk/remote_services/topology_manager/private/src/activator.c?rev=1627453&r1=1627452&r2=1627453&view=diff
>
>
==============================================================================
> --- celix/trunk/remote_services/topology_manager/private/src/activator.c
> (original)
> +++ celix/trunk/remote_services/topology_manager/private/src/activator.c
> Thu Sep 25 04:38:53 2014
> @@ -135,7 +135,7 @@ celix_status_t bundleActivator_start(voi
>
> snprintf(scope, len, "(&(%s=*)(!(%s=%s)))",
> OSGI_FRAMEWORK_OBJECTCLASS, OSGI_RSA_ENDPOINT_FRAMEWORK_UUID, uuid);
>
> - fw_log(logger, OSGI_FRAMEWORK_LOG_ERROR, "TOPOLOGY_MANAGER:
> endpoint listener scope is %s", scope);
> + fw_log(logger, OSGI_FRAMEWORK_LOG_INFO, "TOPOLOGY_MANAGER:
> endpoint listener scope is %s", scope);
>
> properties_pt props = properties_create();
> properties_set(props, (char *) OSGI_ENDPOINT_LISTENER_SCOPE,
> scope);
>
>
>
-- Met vriendelijke groet,
Alexander Broekhuis