// Path: src/main/java/x/mvmn/lang/util/DateHelper.java
// public class DateHelper {
// 	private static final FastDateFormat FDF = FastDateFormat.getInstance("yyyy-MM-dd HH:mm:ss.SSS");
// 
// 	public static String getDateSortFriendlyStr() {
// 		return FDF.format(Calendar.getInstance());
// 	}
// }
// 
// Path: src/main/java/x/mvmn/log/api/Logger.java
// public interface Logger {
// 
// 	public static enum LogLevel {
// 		TRACE, DEBUG, INFO, WARN, ERROR, SEVERE, FATAL
// 	}
// 
// 	public Logger setLevel(LogLevel level);
// 
// 	public LogLevel getLevel();
// 
// 	public boolean shouldLog(LogLevel logLevel);
// 
// 	public Logger log(LogLevel level, String text);
// 
// 	public Logger log(LogLevel level, String text, Throwable t);
// 
// 	public Logger log(LogLevel level, Throwable t);
// 
// 	public Logger trace(String text);
// 
// 	public Logger trace(String text, Throwable t);
// 
// 	public Logger trace(Throwable t);
// 
// 	public Logger debug(String text);
// 
// 	public Logger debug(String text, Throwable t);
// 
// 	public Logger debug(Throwable t);
// 
// 	public Logger info(String text);
// 
// 	public Logger info(String text, Throwable t);
// 
// 	public Logger info(Throwable t);
// 
// 	public Logger warn(String text);
// 
// 	public Logger warn(String text, Throwable t);
// 
// 	public Logger warn(Throwable t);
// 
// 	public Logger error(String text);
// 
// 	public Logger error(String text, Throwable t);
// 
// 	public Logger error(Throwable t);
// 
// 	public Logger severe(String text);
// 
// 	public Logger severe(String text, Throwable t);
// 
// 	public Logger severe(Throwable t);
// 
// 	public Logger fatal(String text);
// 
// 	public Logger fatal(String text, Throwable t);
// 
// 	public Logger fatal(Throwable t);
// }


import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import x.mvmn.lang.util.DateHelper;
import x.mvmn.log.api.Logger;
package x.mvmn.log;



public class PrintStreamLogger extends AbstractLogger {

	private final PrintStream out;

	public PrintStreamLogger(final PrintStream out) {
		this.out = out;
	}

	private String getDateStr() {
		return DateHelper.getDateSortFriendlyStr();
	}

	private String stacktraceToString(final Throwable t) {
		StringWriter writer = new StringWriter();
		t.printStackTrace(new PrintWriter(writer));
		return writer.toString();
	}

	private String concatStr(final String... strings) {
		StringBuilder result = new StringBuilder();
		for (String str : strings) {
			result.append(str);
		}
		return result.toString();
	}

	public Logger log(final LogLevel level, final Throwable t) {
		if (shouldLog(level)) {
			out.println(concatStr(getDateStr(), " - ", level.toString(), ":\n", stacktraceToString(t)));
		}
		return this;
	}

// Path: src/main/java/x/mvmn/lang/util/DateHelper.java
// public class DateHelper {
// 	private static final FastDateFormat FDF = FastDateFormat.getInstance("yyyy-MM-dd HH:mm:ss.SSS");
// 
// 	public static String getDateSortFriendlyStr() {
// 		return FDF.format(Calendar.getInstance());
// 	}
// }
// 
// Path: src/main/java/x/mvmn/log/api/Logger.java
// public interface Logger {
// 
// 	public static enum LogLevel {
// 		TRACE, DEBUG, INFO, WARN, ERROR, SEVERE, FATAL
// 	}
// 
// 	public Logger setLevel(LogLevel level);
// 
// 	public LogLevel getLevel();
// 
// 	public boolean shouldLog(LogLevel logLevel);
// 
// 	public Logger log(LogLevel level, String text);
// 
// 	public Logger log(LogLevel level, String text, Throwable t);
// 
// 	public Logger log(LogLevel level, Throwable t);
// 
// 	public Logger trace(String text);
// 
// 	public Logger trace(String text, Throwable t);
// 
// 	public Logger trace(Throwable t);
// 
// 	public Logger debug(String text);
// 
// 	public Logger debug(String text, Throwable t);
// 
// 	public Logger debug(Throwable t);
// 
// 	public Logger info(String text);
// 
// 	public Logger info(String text, Throwable t);
// 
// 	public Logger info(Throwable t);
// 
// 	public Logger warn(String text);
// 
// 	public Logger warn(String text, Throwable t);
// 
// 	public Logger warn(Throwable t);
// 
// 	public Logger error(String text);
// 
// 	public Logger error(String text, Throwable t);
// 
// 	public Logger error(Throwable t);
// 
// 	public Logger severe(String text);
// 
// 	public Logger severe(String text, Throwable t);
// 
// 	public Logger severe(Throwable t);
// 
// 	public Logger fatal(String text);
// 
// 	public Logger fatal(String text, Throwable t);
// 
// 	public Logger fatal(Throwable t);
// }


// Path: src/main/java/x/mvmn/log/PrintStreamLogger.java
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import x.mvmn.lang.util.DateHelper;
import x.mvmn.log.api.Logger;

package x.mvmn.log;



public class PrintStreamLogger extends AbstractLogger {

	private final PrintStream out;

	public PrintStreamLogger(final PrintStream out) {
		this.out = out;
	}

	private String getDateStr() {
		return DateHelper.getDateSortFriendlyStr();
	}

	private String stacktraceToString(final Throwable t) {
		StringWriter writer = new StringWriter();
		t.printStackTrace(new PrintWriter(writer));
		return writer.toString();
	}

	private String concatStr(final String... strings) {
		StringBuilder result = new StringBuilder();
		for (String str : strings) {
			result.append(str);
		}
		return result.toString();
	}

	public Logger log(final LogLevel level, final Throwable t) {
		if (shouldLog(level)) {
			out.println(concatStr(getDateStr(), " - ", level.toString(), ":\n", stacktraceToString(t)));
		}
		return this;
	}

	public Logger log(final LogLevel level, final String text, final Throwable t) {