public static Statement newInstance(Statement stmt, Log statementLog, int queryStack) {
    InvocationHandler handler = new StatementLogger(stmt, statementLog, queryStack);
    ClassLoader cl = Statement.class.getClassLoader();
    return (Statement) Proxy.newProxyInstance(cl, new Class[]{Statement.class}, handler);
  }
Statement proxy to add logging

@author Clinton Begin
@author Eduardo Macarron
src/main/java/org/apache/ibatis/logging/jdbc/StatementLogger.java