X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fconfig%2Fconfig.c;h=48dc0b0341eac709442da6fab1bdcc6136bc05b5;hb=b83e03c49920557f292d3861f42d0109e6fa03ea;hp=03601be486deacc189f260251108534156aa0c1c;hpb=847a5916c26ab9cc0dfc9322cccd2c748c54747e;p=lttng-tools.git diff --git a/src/common/config/config.c b/src/common/config/config.c index 03601be48..48dc0b034 100644 --- a/src/common/config/config.c +++ b/src/common/config/config.c @@ -340,11 +340,10 @@ static xmlChar *encode_string(const char *in_str) in_len = strlen(in_str); /* - * Add 1 byte for the NULL terminted character. The factor 2 here is - * because UTF-8 can be on two bytes so this fits the worst case for each - * bytes. + * Add 1 byte for the NULL terminted character. The factor 4 here is + * used because UTF-8 characters can take up to 4 bytes. */ - out_len = (in_len * 2) + 1; + out_len = (in_len * 4) + 1; out_str = xmlMalloc(out_len); if (!out_str) { goto end; @@ -1428,6 +1427,26 @@ 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_PYTHON: + event.loglevel = LTTNG_LOGLEVEL_PYTHON_DEBUG; + 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)) {