Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] around() Problem

Hi,

I've tried now some time to catch all System.outs in my code and can't make it.

In the end I want to catch alle the outputs in an existing application and want to write it
to a logfile.

But for testing I simply want to catch all System.outs with this code:

public aspect SystemOut {
   pointcut pprint(String str) :
       call(void System.out.println(*)) && target(str) ;

   void around(String str) : pprint(str) {
       System.out.println("Catched in " + thisJoinPoint + ": " + str);
       proceed(str);
   }
}

And I always get the message: no match for this type name
But I extra put in this line of code to test: System.out.println("Test");

What I am doing wrong?
Is there a problem because System.out.println exists for a lot of objects?
I want to catch them independent if it's called with an int or a String or ....

Thanks,
Michael







Back to the top