我尝试在我的方法中打印异常和参数。但是我的代码得不到任何结果。
import com.sun.btrace.annotations.*;
import static com.sun.btrace.BTraceUtils.*;
@BTrace
public class HelloWorld {
@OnMethod(clazz = "com.btrace.test.service.UserServiceImpl"
, method = "test", location = @Location(Kind.ERROR))
public static void onThreadStart(Throwable exception, @Self Object self, String param1
, @Return AnyType result, @Duration long duration) {
println("UserServiceImpl param1=" + param1);
Threads.jstack(exception);
}
}发布于 2018-04-03 02:59:04
在当前版本1.3.10.2中不可能
在master中,对此的支持是最近添加的https://github.com/btraceio/btrace/issues/327
您只需要用@TargetInstance注释Throwable参数
https://stackoverflow.com/questions/47287681
复制相似问题