All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.tangjiabao.halodb.utils.logger.LogUtils Maven / Gradle / Ivy

Go to download

Orm whitch The highest development efficiency and Efficiency is the fastest

There is a newer version: 0.17
Show newest version
package cn.tangjiabao.halodb.utils.logger;

/**
 * 日志组件
 * @author [email protected]
 * @date 2015-6-14 下午10:36:14
 */
public class LogUtils {

	/**
	 * 美化日志输出
	 * @param message
	 * @return Object
	 */
	public static String format(Object... message) {
		StringBuffer sb = new StringBuffer();
		for (Object object : message) {
			sb.append("\n").append(String.valueOf(object));
		}
		return sb.toString();
	}

	/**
	 * 简单美化输出
	 * @param info
	 * @param message
	 * @return Object
	 */
	public static String formatOL(String info, Object message) {
		StringBuffer sb = new StringBuffer();
		sb.append("\n").append(info).append(":::").append(String.valueOf(message));
		return sb.toString();
	}

	/**
	 *  输出数组
	 * @param info
	 * @param attr
	 * @return Object
	 */
	public static String attr(String info, Object[] attr) {
		StringBuffer sb = new StringBuffer();
		sb.append("\n").append(info).append("\n");
		for (Object object : attr) {
			sb.append(String.valueOf(object)).append(";");
		}
		return sb.toString();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy