package org.fouram.core.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class LoggerUtil {

	private static Logger logger = LoggerFactory.getLogger(LoggerUtil.class);

	public static void error(Exception e) {
		try {
			String sOut = e.toString() + "\r\n";
			StackTraceElement[] trace = e.getStackTrace();
			for (StackTraceElement s : trace) {
				sOut += "\tat " + s + "\r\n";
			}
			logger.error(sOut);
		} catch (Exception e1) {
			e1.printStackTrace();
		}
	}

	public static void info(Object sOut) {
		try {
			logger.info(sOut.toString());
		} catch (Exception e) {
			LoggerUtil.error(e);
		}
	}
}