📄 loginfo.java
字号:
package lib.commons.logging;
import java.util.Date;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.commons.lang.time.DateFormatUtils;
import lib.commons.Utils;
public class LogInfo {
private String logName, logLevelName;
private int logLevel;
private boolean printStackTrace;
private Object logMessage;
private Throwable logThrowable;
private Date logDate;
public LogInfo(String logName, int logLevel, boolean printStackTrace,
Object logMessage, Throwable logThrowable, Date logDate) {
this.logName = logName;
this.logLevel = logLevel;
this.printStackTrace = printStackTrace;
this.logMessage = logMessage;
this.logThrowable = logThrowable;
this.logDate = (null == logDate ? new Date() : logDate);
}
public String getLogName() {
return null == logName ? Utils.EMPTY_STRING : logName;
}
public int getLogLevel() {
return logLevel;
}
public String getLogLevelName() {
if (null == logLevelName)
logLevelName = LogLevel.getLevelName(logLevel);
return logLevelName;
}
public boolean isPrintStackTrace() {
return printStackTrace;
}
public Object getLogMessage() {
return logMessage;
}
public Throwable getLogThrowable() {
return logThrowable;
}
public String getLogThrowableString() {
if (null == logThrowable)
return null;
return ExceptionUtils.getFullStackTrace(logThrowable);
}
public Date getLogDate() {
return logDate;
}
public String getLogDateFormatString(String dateFormat) {
return DateFormatUtils.format(logDate, dateFormat);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -