|
12 | 12 | import org.elasticsearch.entitlement.instrumentation.CheckMethod; |
13 | 13 | import org.elasticsearch.entitlement.instrumentation.Instrumenter; |
14 | 14 | import org.elasticsearch.entitlement.instrumentation.MethodKey; |
| 15 | +import org.elasticsearch.logging.LogManager; |
| 16 | +import org.elasticsearch.logging.Logger; |
15 | 17 | import org.objectweb.asm.AnnotationVisitor; |
16 | 18 | import org.objectweb.asm.ClassReader; |
17 | 19 | import org.objectweb.asm.ClassVisitor; |
|
36 | 38 | import static org.objectweb.asm.Opcodes.INVOKEVIRTUAL; |
37 | 39 |
|
38 | 40 | public class InstrumenterImpl implements Instrumenter { |
| 41 | + private static final Logger logger = LogManager.getLogger(InstrumenterImpl.class); |
39 | 42 |
|
40 | 43 | private final String getCheckerClassMethodDescriptor; |
41 | 44 | private final String handleClass; |
@@ -155,10 +158,10 @@ public MethodVisitor visitMethod(int access, String name, String descriptor, Str |
155 | 158 | var key = new MethodKey(className, name, Stream.of(Type.getArgumentTypes(descriptor)).map(Type::getInternalName).toList()); |
156 | 159 | var instrumentationMethod = checkMethods.get(key); |
157 | 160 | if (instrumentationMethod != null) { |
158 | | - // System.out.println("Will instrument method " + key); |
| 161 | + logger.debug("Will instrument {}", key); |
159 | 162 | return new EntitlementMethodVisitor(Opcodes.ASM9, mv, isStatic, isCtor, descriptor, instrumentationMethod); |
160 | 163 | } else { |
161 | | - // System.out.println("Will not instrument method " + key); |
| 164 | + logger.trace("Will not instrument {}", key); |
162 | 165 | } |
163 | 166 | } |
164 | 167 | return mv; |
|
0 commit comments