In Matlab's enumeration scheme, the enumerated values must be instances of the class containing the enum. So e.g. WARNING
would have to a certain LogEvent
instance.
E.g. like in this example from the docs:
classdef Bearing < uint32
enumeration
North (0)
East (90)
South (180)
West (270)
end
end
Which means in your case, you'd have to specify arguments which would fit your LogEvent-constructor - this is what the error message says, basically. Which is of course totally nonsense in your use-case.
In your special case, you'd better make ERROR
, WARNING
and INFO
constant properties:
properties (Constant)
INFO = 1;
WARNING = 2;
ERROR = 3;
end
You can access constants in a static manner, so your remaining code should pretty much work with this version.