⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 loglayout.java

📁 用java开发的一些实用的短信通信模块其中包含MD5加密、http发送等信息
💻 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 + -