+/*
+ * Returns the human-readable log level name associated with a numerical value
+ * if there is one. The Log4j and JUL domains have discontinuous log level
+ * values (a value can fall between two labels). In those cases, NULL is
+ * returned.
+ */
+static const char *get_pretty_loglevel_name(
+ enum lttng_domain_type domain, int loglevel)
+{
+ const char *name = NULL;
+
+ switch (domain) {
+ case LTTNG_DOMAIN_UST:
+ name = loglevel_value_to_name(loglevel);
+ break;
+ case LTTNG_DOMAIN_LOG4J:
+ name = loglevel_log4j_value_to_name(loglevel);
+ break;
+ case LTTNG_DOMAIN_JUL:
+ name = loglevel_jul_value_to_name(loglevel);
+ break;
+ case LTTNG_DOMAIN_PYTHON:
+ name = loglevel_python_value_to_name(loglevel);
+ break;
+ default:
+ break;
+ }
+
+ return name;
+}
+