- int err;
-
- if (ev->name[0] != '*') {
- if (filter_expression) {
- err = asprintf(&jul_filter, "%s && logger_name == \"%s\"",
- filter_expression, ev->name);
- } else {
- err = asprintf(&jul_filter, "logger_name == \"%s\"",
- ev->name);
- }
- if (err < 0) {
- PERROR("asprintf");
- return -LTTNG_ERR_NOMEM;
- }
- filter_expression = jul_filter;
- }
-
- /* Add loglevel filtering if any for the JUL domain. */
- if (ev->loglevel_type != LTTNG_EVENT_LOGLEVEL_ALL) {
- char *op;
-
- if (ev->loglevel_type == LTTNG_EVENT_LOGLEVEL_RANGE) {
- op = ">=";
- } else {
- op = "==";
- }
-
- if (filter_expression) {
- err = asprintf(&jul_filter, "%s && int_loglevel %s %d",
- filter_expression, op, ev->loglevel);
- } else {
- err = asprintf(&jul_filter, "int_loglevel %s %d", op,
- ev->loglevel);
- }
- if (err < 0) {
- PERROR("asprintf");
- return -LTTNG_ERR_NOMEM;
- }
- filter_expression = jul_filter;
- }
-