mirror of
https://github.com/alibaba/testable-mock.git
synced 2025-03-13 11:20:32 +08:00
always print out context path of testable agent
This commit is contained in:
parent
7cda8ffd36
commit
4ea97fe13f
@ -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);
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user