always print out context path of testable agent

This commit is contained in:
金戟 2021-05-03 10:56:36 +08:00
parent 7cda8ffd36
commit 4ea97fe13f
2 changed files with 11 additions and 0 deletions

View File

@ -9,6 +9,8 @@ import com.alibaba.ttl.threadpool.agent.TtlAgent;
import java.lang.instrument.Instrumentation;
import static com.alibaba.testable.agent.constant.ConstPool.PROPERTY_USER_DIR;
/**
* Agent entry, dynamically modify the byte code of classes under testing
* @author flin
@ -19,6 +21,7 @@ public class PreMain {
ArgumentParser.parseArgs(agentArgs);
PropertiesParser.parseFile(ArgumentParser.configFilePath);
GlobalConfig.setupLogRootPath();
LogUtil.info("TestableMock start at %s", System.getProperty(PROPERTY_USER_DIR));
if (GlobalConfig.shouldEnhanceThreadLocal()) {
// add transmittable thread local transformer
TtlAgent.premain(agentArgs, inst);

View File

@ -44,6 +44,14 @@ public class LogUtil {
write(text);
}
public static void info(String msg, Object... args) {
String text = String.format("[INFO] " + msg + "\n", args);
if (currentLogLevel.level >= LogLevel.DEFAULT.level) {
System.out.print(text);
}
write(text);
}
public static void warn(String msg, Object... args) {
String text = String.format("[WARN] " + msg + "\n", args);
if (currentLogLevel.level >= LogLevel.DEFAULT.level) {