presto-plugin-toolkit/src/main/java/io/prestosql/plugin/base/util/LoggingInvocationHandler.java/LoggingInvocationHandler/handleInvocation
class LoggingInvocationHandler:    @Override
    protected Object handleInvocation(Object proxy, Method method, Object[] args)
            throws Throwable
    {
        Object result;
        long startNanos = System.nanoTime();
        try {
            result = method.invoke(delegate, args);
        }
        catch (InvocationTargetException e) {
            Duration elapsed = Duration.nanosSince(startNanos);
            Throwable t = e.getCause();
            logger.accept(format("%s took %s and failed with %s", invocationDescription(method, args), elapsed, t));
            throw t;
        }
        Duration elapsed = Duration.nanosSince(startNanos);
        logger.accept(format("%s succeeded in %s", invocationDescription(method, args), elapsed));
        return result;
    }