- def _specific_context_field_class(self, context_field_class):
- if context_field_class is not None:
- utils._check_type(context_field_class, bt2_field_class._StructureFieldClass)
- status = native_bt.event_class_set_specific_context_field_class(
- self._ptr, context_field_class._ptr
- )
- utils._handle_func_status(
- status, "cannot set event class object's context field class"
+ _payload_field_class = property(fset=_payload_field_class)
+
+ @staticmethod
+ def _validate_create_params(
+ name,
+ user_attributes,
+ log_level,
+ emf_uri,
+ specific_context_field_class,
+ payload_field_class,
+ ):
+ if name is not None:
+ utils._check_str(name)
+
+ if user_attributes is not None:
+ value = bt2_value.create_value(user_attributes)
+ utils._check_type(value, bt2_value.MapValue)
+
+ if log_level is not None:
+ log_levels = (
+ EventClassLogLevel.EMERGENCY,
+ EventClassLogLevel.ALERT,
+ EventClassLogLevel.CRITICAL,
+ EventClassLogLevel.ERROR,
+ EventClassLogLevel.WARNING,
+ EventClassLogLevel.NOTICE,
+ EventClassLogLevel.INFO,
+ EventClassLogLevel.DEBUG_SYSTEM,
+ EventClassLogLevel.DEBUG_PROGRAM,
+ EventClassLogLevel.DEBUG_PROCESS,
+ EventClassLogLevel.DEBUG_MODULE,
+ EventClassLogLevel.DEBUG_UNIT,
+ EventClassLogLevel.DEBUG_FUNCTION,
+ EventClassLogLevel.DEBUG_LINE,
+ EventClassLogLevel.DEBUG,