Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Generic Loggin of Method Parameters?

Thank you, it worked
but how can i get the return value?

i try to do something like this:

after(): logMethod(){
Logger log = Logger.getLogger(assembleFullName(thisJoinPointStaticPart));
        Object returnValue= ((MethodSignature)thisJoinPoint. ?? ;
        if (log.isEnabledFor(Level.INFO)){
log.info("returns: '"+returnValue+"'"); }
   }

thanks a lot
Roland


Stephan Kolp schrieb:

In your advices you can use the member thisJoinPoint. It is of type JoinPoint. JoinPoint has some methods that provide more information.

I think
    thisJoinPoint.getArgs()
will work.

See API-Doc (http://www.eclipse.org/aspectj/doc/released/api/index.html) for more Information.


Roland Kofler schrieb:

Hi all,
As a newbie I digged a half day for a generic solution that allows me to log any parameter I pass to any method in my package. But I cant find a way to get a "reflective" or "dynamic" list of parameters from a method's call

Can you give me advice ;-)?
Thank you a lot!

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users




Back to the top