📄 loglayout.java
字号:
package lib.commons.logging;
import java.io.PrintWriter;
import java.io.StringWriter;
import lib.commons.Utils;
import org.apache.commons.configuration.Configuration;
public class LogLayout {
public LogLayout(Configuration configuration) {}
public String formatLogInfo(LogInfo logInfo) {
if (null == logInfo)
return Utils.EMPTY_STRING;
if (!logInfo.isPrintStackTrace())
return null == logInfo.getLogMessage() ? Utils.EMPTY_STRING
: logInfo.getLogMessage().toString();
StringWriter stringWriter = new StringWriter();
PrintWriter writer = new PrintWriter(stringWriter);
writer.print(null == logInfo.getLogMessage() ? Utils.EMPTY_STRING
: logInfo.getLogMessage().toString());
if (null != logInfo.getLogThrowable()) {
writer.println();
logInfo.getLogThrowable().printStackTrace(writer);
}
return stringWriter.toString();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -