init: refine verbosity handling

This patch makes service-announce messages depend on the configured
verbosity. It also omits "parent provides" title messages if no new
parent services are added during a config update.
This commit is contained in:
Norman Feske 2017-12-13 20:14:46 +01:00 committed by Christian Helmuth
parent 30f96657f1
commit e23fc5a1fc
2 changed files with 9 additions and 4 deletions

View File

@ -606,7 +606,8 @@ Genode::Affinity Init::Child::filter_session_affinity(Affinity const &session_af
void Init::Child::announce_service(Service::Name const &service_name)
{
log("child \"", name(), "\" announces service \"", service_name, "\"");
if (_verbose.enabled())
log("child \"", name(), "\" announces service \"", service_name, "\"");
bool found = false;
_child_services.for_each([&] (Routed_service &service) {

View File

@ -182,8 +182,8 @@ void Init::Main::_update_parent_services_from_config()
service.abandon();
});
if (_verbose->enabled())
log("parent provides");
/* used to prepend the list of new parent services with title */
bool first_log = true;
/* register new services */
node.for_each_sub_node("service", [&] (Xml_node service) {
@ -197,8 +197,12 @@ void Init::Main::_update_parent_services_from_config()
if (!registered) {
new (_heap) Init::Parent_service(_parent_services, _env, name);
if (_verbose->enabled())
if (_verbose->enabled()) {
if (first_log)
log("parent provides");
log(" service \"", name, "\"");
first_log = false;
}
}
});
}