How to capture the parameters of System.out.println() in AspectJ's aspect and display in pointcut?

前端 未结 2 1715
[愿得一人]
[愿得一人] 2021-01-21 07:21

I am very new to AspectJ...just started to learn. Till now i am able to get the parameters of user defined method in my aspect and print the captured parameter in my pointcut.

2条回答
  •  旧时难觅i
    2021-01-21 07:55

    I was shocked still .. 2 days after posting,no one answered my this question... but its fine i have found a solution and realized where i was wrong. it was the mistake in my signature of println method().

    This is the correct signature of println:

     void around(String str) : 
        call(void java.io.PrintStream.println(String)) && args(str)
    

    and it worked fine for me . .

提交回复
热议问题