z11.logging.Logger Maven / Gradle / Ivy
package z11.logging;
import z11.*;
/**
*
* @author vietduc
*/
public class Logger {
private static String logFileName = "";
private static final String logFolder = "logs";
public static void print(String str){
if (logFileName.equals("")){
z11.F_ile.createFolder(logFolder);
logFileName = logFolder + "/log_" + z11.D_ate.getDateString("yyyy-MM-dd_HH-mm-ss") + ".txt";
}
z11.F_ile.writeStringToFile(logFileName, "[" + z11.D_ate.getDateString("yyyy-MM-dd HH:mm:ss") + "] " + str, true);
System.out.println(str);
}
public static void print(){
print(System.lineSeparator());
}
public static void main(String [] args){
Logger.print("123abcabcsdf");
Logger.print("1");
}
}