From: Jérémie Galarneau Date: Mon, 31 Aug 2015 22:53:51 +0000 (-0400) Subject: Initialize default log level of events on load X-Git-Tag: v2.6.1~63 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=278b6f1260cf10135ac0f6b30e45c26518c6bf59;p=lttng-tools.git Initialize default log level of events on load Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/config/config.c b/src/common/config/config.c index 950fec4d1..dca765b0f 100644 --- a/src/common/config/config.c +++ b/src/common/config/config.c @@ -1415,6 +1415,23 @@ int process_event_node(xmlNodePtr event_node, struct lttng_handle *handle, memset(&event, 0, sizeof(event)); + /* Initialize default log level which varies by domain */ + switch (handle->domain.type) + { + case LTTNG_DOMAIN_JUL: + event.loglevel = LTTNG_LOGLEVEL_JUL_ALL; + break; + case LTTNG_DOMAIN_LOG4J: + event.loglevel = LTTNG_LOGLEVEL_LOG4J_ALL; + break; + case LTTNG_DOMAIN_UST: + case LTTNG_DOMAIN_KERNEL: + event.loglevel = LTTNG_LOGLEVEL_DEBUG; + break; + default: + assert(0); + } + for (node = xmlFirstElementChild(event_node); node; node = xmlNextElementSibling(node)) { if (!strcmp((const char *) node->name, config_element_name)) {