feat: logRemover support Logger.info and warning

This commit is contained in:
ReaJason
2024-12-13 00:37:27 +08:00
parent bb76313410
commit 6c523c55c7
19 changed files with 691 additions and 25 deletions
@@ -15,6 +15,7 @@ import org.junit.jupiter.api.Test;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.logging.Logger;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -94,19 +95,26 @@ class LogRemoveVisitorWrapperTest {
}
public static class TestClass {
static Logger logger = Logger.getLogger(TestClass.class.getName());
public TestClass() {
}
public void methodWithLogs() {
public static void methodWithLogs() {
System.out.println("This should be removed");
String test = "test";
int length = test.length();
logger.info(test);
try {
System.out.println("hello");
throw new RuntimeException("hello");
} catch (Exception e) {
e.printStackTrace();
}
logger.warning("wa");
}
public static void main(String[] args) {
methodWithLogs();
}
}
}