63 lines
1.3 KiB
Java
63 lines
1.3 KiB
Java
package com.zhgd.config;
|
|
|
|
import com.zhgd.xmgl.config.TaskAspect;
|
|
import com.zhgd.xmgl.constant.Cts;
|
|
import com.zhgd.xmgl.util.ThreadLocalUtil;
|
|
import org.apache.ibatis.logging.Log;
|
|
|
|
import java.util.Objects;
|
|
|
|
public class StdOutImplCustom implements Log {
|
|
|
|
public StdOutImplCustom(String clazz) {
|
|
// Do Nothing
|
|
}
|
|
|
|
public static Boolean isPrint() {
|
|
if (!Objects.equals(TaskAspect.onlyPrintInterface, 1)) {
|
|
return true;
|
|
}
|
|
return Objects.equals(ThreadLocalUtil.getByKey(Cts.TL_IS_FROM_WEB, Boolean.class), true);
|
|
}
|
|
|
|
@Override
|
|
public boolean isDebugEnabled() {
|
|
return isPrint();
|
|
}
|
|
|
|
@Override
|
|
public boolean isTraceEnabled() {
|
|
return isPrint();
|
|
}
|
|
|
|
@Override
|
|
public void error(String s, Throwable e) {
|
|
System.err.println(s);
|
|
e.printStackTrace(System.err);
|
|
}
|
|
|
|
@Override
|
|
public void error(String s) {
|
|
System.err.println(s);
|
|
}
|
|
|
|
@Override
|
|
public void debug(String s) {
|
|
if (isPrint()) {
|
|
System.out.println(s);
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void trace(String s) {
|
|
if (isPrint()) {
|
|
System.out.println(s);
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void warn(String s) {
|
|
System.out.println(s);
|
|
}
|
|
}
|