/**
* Description 修改目标方法:filterAndLog_1
* @param
* @return void
* @Author dengbp
* @Date 2:20 PM 3/31/22
**/
private void modifyLogLevel_1(){
Label l0 = new Label();
mv.visitLabel(l0);
mv.visitLineNumber(390, l0);
mv.visitVarInsn(Opcodes.ALOAD, 0);
mv.visitLdcInsn(level);
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "ch/qos/logback/classic/Level", "toLevel", "(Ljava/lang/String;)Lch/qos/logback/classic/Level;", false);
mv.visitFieldInsn(Opcodes.GETFIELD, "ch/qos/logback/classic/Level", "levelInt", "I");
mv.visitFieldInsn(Opcodes.PUTFIELD, "ch/qos/logback/classic/Logger", "effectiveLevelInt", "I");
Label l1 = new Label();
mv.visitLabel(l1);
mv.visitLineNumber(392, l1);
mv.visitVarInsn(Opcodes.ALOAD, 0);
mv.visitFieldInsn(Opcodes.GETFIELD, "ch/qos/logback/classic/Logger", "loggerContext", "Lch/qos/logback/classic/LoggerContext;");
mv.visitVarInsn(Opcodes.ALOAD, 2);
mv.visitVarInsn(Opcodes.ALOAD, 0);
mv.visitVarInsn(Opcodes.ALOAD, 3);
mv.visitVarInsn(Opcodes.ALOAD, 4);
mv.visitVarInsn(Opcodes.ALOAD, 5);
mv.visitVarInsn(Opcodes.ALOAD, 6);
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "ch/qos/logback/classic/LoggerContext", "getTurboFilterChainDecision_1", "(Lorg/slf4j/Marker;Lch/qos/logback/classic/Logger;Lch/qos/logback/classic/Level;Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Throwable;)Lch/qos/logback/core/spi/FilterReply;", false);
mv.visitVarInsn(Opcodes.ASTORE, 7);
Label l2 = new Label();
mv.visitLabel(l2);
mv.visitLineNumber(394, l2);
mv.visitVarInsn(Opcodes.ALOAD, 7);
mv.visitFieldInsn(Opcodes.GETSTATIC, "ch/qos/logback/core/spi/FilterReply", "NEUTRAL", "Lch/qos/logback/core/spi/FilterReply;");
Label l3 = new Label();
mv.visitJumpInsn(Opcodes.IF_ACMPNE, l3);
Label l4 = new Label();
mv.visitLabel(l4);
mv.visitLineNumber(395, l4);
mv.visitVarInsn(Opcodes.ALOAD, 0);
mv.visitFieldInsn(Opcodes.GETFIELD, "ch/qos/logback/classic/Logger", "effectiveLevelInt", "I");
mv.visitVarInsn(Opcodes.ALOAD, 3);
mv.visitFieldInsn(Opcodes.GETFIELD, "ch/qos/logback/classic/Level", "levelInt", "I");
Label l5 = new Label();
mv.visitJumpInsn(Opcodes.IF_ICMPLE, l5);
Label l6 = new Label();
mv.visitLabel(l6);
mv.visitLineNumber(396, l6);
mv.visitInsn(Opcodes.RETURN);
mv.visitLabel(l3);
mv.visitLineNumber(398, l3);
mv.visitFrame(Opcodes.F_APPEND, 1, new Object[]{"ch/qos/logback/core/spi/FilterReply"}, 0, null);
mv.visitVarInsn(Opcodes.ALOAD, 7);
mv.visitFieldInsn(Opcodes.GETSTATIC, "ch/qos/logback/core/spi/FilterReply", "DENY", "Lch/qos/logback/core/spi/FilterReply;");
mv.visitJumpInsn(Opcodes.IF_ACMPNE, l5);
Label l7 = new Label();
mv.visitLabel(l7);
mv.visitLineNumber(399, l7);
mv.visitInsn(Opcodes.RETURN);
mv.visitLabel(l5);
mv.visitLineNumber(402, l5);
mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null);
mv.visitVarInsn(Opcodes.ALOAD, 0);
mv.visitVarInsn(Opcodes.ALOAD, 1);
mv.visitVarInsn(Opcodes.ALOAD, 2);
mv.visitVarInsn(Opcodes.ALOAD, 3);
mv.visitVarInsn(Opcodes.ALOAD, 4);
mv.visitInsn(Opcodes.ICONST_1);
mv.visitTypeInsn(Opcodes.ANEWARRAY, "java/lang/Object");
mv.visitInsn(Opcodes.DUP);
mv.visitInsn(Opcodes.ICONST_0);
mv.visitVarInsn(Opcodes.ALOAD, 5);
mv.visitInsn(Opcodes.AASTORE);
mv.visitVarInsn(Opcodes.ALOAD, 6);
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "ch/qos/logback/classic/Logger", "buildLoggingEventAndAppend", "(Ljava/lang/String;Lorg/slf4j/Marker;Lch/qos/logback/classic/Level;Ljava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V", false);
Label l8 = new Label();
mv.visitLabel(l8);
mv.visitLineNumber(403, l8);
mv.visitInsn(Opcodes.RETURN);
Label l9 = new Label();
mv.visitLabel(l9);
mv.visitLocalVariable("this", "Lch/qos/logback/classic/Logger;", null, l0, l9, 0);
mv.visitLocalVariable("localFQCN", "Ljava/lang/String;", null, l0, l9, 1);
mv.visitLocalVariable("marker", "Lorg/slf4j/Marker;", null, l0, l9, 2);
mv.visitLocalVariable("level", "Lch/qos/logback/classic/Level;", null, l0, l9, 3);
mv.visitLocalVariable("msg", "Ljava/lang/String;", null, l0, l9, 4);
mv.visitLocalVariable("param", "Ljava/lang/Object;", null, l0, l9, 5);
mv.visitLocalVariable("t", "Ljava/lang/Throwable;", null, l0, l9, 6);
mv.visitLocalVariable("decision", "Lch/qos/logback/core/spi/FilterReply;", null, l2, l9, 7);
mv.visitMaxs(9, 8);
mv.visitEnd();
}
|