GString *emf_uri;
bt_event_class_log_level log_level;
bool is_translated;
+ bool is_log_level_set;
/* Owned by this */
struct ctf_field_class *spec_context_fc;
BT_ASSERT(ec->name);
ec->emf_uri = g_string_new(NULL);
BT_ASSERT(ec->emf_uri);
- ec->log_level = -1;
+ ec->is_log_level_set = false;
return ec;
}
+static inline
+void ctf_event_class_set_log_level(struct ctf_event_class *ec,
+ enum bt_event_class_log_level log_level)
+{
+ BT_ASSERT(ec);
+ ec->log_level = log_level;
+ ec->is_log_level_set = true;
+}
+
static inline
void ctf_event_class_destroy(struct ctf_event_class *ec)
{
_SET(set, _EVENT_FIELDS_SET);
} else if (strcmp(left, "loglevel") == 0) {
uint64_t loglevel_value;
+ bool is_log_level_known = true;
bt_event_class_log_level log_level = -1;
if (_IS_SET(set, _EVENT_LOG_LEVEL_SET)) {
log_level = BT_EVENT_CLASS_LOG_LEVEL_DEBUG;
break;
default:
+ is_log_level_known = false;
_BT_COMP_LOGW_NODE(node, "Not setting event class's log level because its value is unknown: "
"log-level=%" PRIu64, loglevel_value);
}
- if (log_level != -1) {
- event_class->log_level = log_level;
+ if (is_log_level_known) {
+ ctf_event_class_set_log_level(event_class, log_level);
}
_SET(set, _EVENT_LOG_LEVEL_SET);