Hello

For a specific method, I need to log some information when the method is 
called, like the state of the receiver, values of arguments, where the method 
is called, ... .

Using following MetaLink, I’m able to capture the receiver and arguments and 
context. 

link := MetaLink new
                        metaObject: self;
                        selector:
                                
#linkBeforeMethodArguments:receiver:selector:context:;
                        control: #before;
                        level: 0;
                        arguments: #( arguments receiver selector context ). 
aMethod := MyClass methodNamed: #myMethodArg1:arg2.
aMethod ast link: link

For capturing the information related to where this method is called, It's 
possible to extract it from Context, but it’s a dirty way. 
Is there any way to access the MessageNode which called this MethodNode?

Best regards,
Mehrdad

Reply via email to