fix loging

This commit is contained in:
金戟 2021-04-02 23:50:39 +08:00
parent 7b2f967626
commit 1ced04bf29
2 changed files with 4 additions and 4 deletions

View File

@ -40,7 +40,7 @@ public class TestClassHandler extends BaseClassWithContextHandler {
protected void transform(ClassNode cn) {
Framework framework = checkFramework(cn);
if (framework == null) {
LogUtil.warn("Failed to detect test framework for " + cn.name);
LogUtil.warn("Failed to detect test framework for %s", cn.name);
return;
}
if (!framework.hasTestAfterMethod) {
@ -50,7 +50,7 @@ public class TestClassHandler extends BaseClassWithContextHandler {
handleTestableUtil(mn);
handleTestCaseMethod(mn, framework);
}
LogUtil.diagnose(String.format(" Found %d test cases", testCaseCount));
LogUtil.diagnose(" Found %d test cases", testCaseCount);
}
private Framework checkFramework(ClassNode cn) {
@ -96,7 +96,7 @@ public class TestClassHandler extends BaseClassWithContextHandler {
private void handleTestCaseMethod(MethodNode mn, Framework framework) {
TestCaseMethodType type = framework.checkMethodType(mn);
if (type.equals(TestCaseMethodType.TEST)) {
LogUtil.verbose(String.format(" Test case \"%s\"", mn.name));
LogUtil.verbose(" Test case \"%s\"", mn.name);
injectMockContextInit(mn);
testCaseCount++;
} else if (type.equals(TestCaseMethodType.AFTER_TEST)) {

View File

@ -186,7 +186,7 @@ public class TestableClassTransformer implements ClassFileTransformer {
ClassNode innerClassNode = ClassUtil.getClassNode(ic.name);
if (ic.name.equals(getInnerMockClassName(cn.name)) && mockClassParser.isMockClass(innerClassNode)) {
if ((ic.access & ACC_STATIC) == 0) {
LogUtil.warn(String.format("Mock class in \"%s\" is not declared as static", cn.name));
LogUtil.warn("Mock class in \"%s\" is not declared as static", cn.name);
} else {
ic.access = BytecodeUtil.toPublicAccess(ic.access);
return ic.name;