Where can I find documentation about Eiffel introspection?
Some functions can be called in the GENERAL Class
I'm looking for the caller's class name to modify the logger's formatter
Something like:
Current.generator_client_object.class_name
Where can I find documentation about Eiffel introspection?
Some functions can be called in the GENERAL Class
I'm looking for the caller's class name to modify the logger's formatter
Something like:
Current.generator_client_object.class_name
It's possible to lookup for a class name of an object with generator
. More detailed information can be obtained with other means, sorted from higher level to lower level:
generating_type
that returns an object of type TYPE
REFLECTED_OBJECT
(there are versions for a reference object and for an expanded object) to dig into an object structureREFLECTOR
or INTERNAL
for lower-level manipulations with less abstractionThere is no standard mechanism to fetch the details of the currently executing feature or its caller. It still might be possible to obtain this information from the exception stack trace. The idea is as follows:
{EXCEPTION}.trace
one or two level up (some experiments are needed to get the correct result).Although, this is feasible, the performance is going to be an issue, because exception handling and parsing are slow operations.