com.fastchar.core.FastLog Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of FastChar Show documentation
Show all versions of FastChar Show documentation
FastChar is Web+ORM Framework in Java
Copyright (C) http://www.fastchar.com
All rights reserved.
The newest version!
package com.fastchar.core;
import com.fastchar.utils.FastClassUtils;
import com.fastchar.utils.FastDateUtils;
public final class FastLog {
public FastLog() {
}
public void info(Class targetClass, String message) {
info(targetClass, message, null);
}
public void info(Class targetClass, String message,Throwable throwable) {
System.out.println("\n" + FastDateUtils.getDateString());
System.out.println("[INFO]:" + lightStyle(message));
}
public void error(Class targetClass, String message) {
error(targetClass, message, null);
}
public void error(Class targetClass, String message,Throwable throwable) {
System.err.println("\n" + FastDateUtils.getDateString());
System.err.println("[ERROR]:" + errorStyle(message));
}
public void warn(Class targetClass, String message) {
warn(targetClass, message, null);
}
public void warn(Class targetClass, String message,Throwable throwable) {
System.out.println("\n" + FastDateUtils.getDateString());
System.out.println("[WARN]:" + warnStyle(message));
}
public String lightStyle(String content) {
return "\033[32;1m" + content + "\033[0m";
}
public String softStyle(String content) {
return "\033[36;1m" + content + "\033[0m";
}
public String warnStyle(String content) {
return "\033[33;1m" + content + "\033[0m";
}
public String errorStyle(String content) {
return "\033[31;1m" + content + "\033[0m";
}
public static void main(String[] args) {
new FastLog().info(FastLog.class, "测试消息!");
}
}