0

我正在尝试在我的方法中打印异常和参数。但我无法从我的代码中得到任何结果。

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);

    }
}
4

1 回答 1

0

Not possible in the current version 1.3.10.2

In master the support for this was added recently https://github.com/btraceio/btrace/issues/327

You just need to annotate the Throwable argument with @TargetInstance

于 2018-04-02T18:59:03.887 回答