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

z11.L_ogger Maven / Gradle / Ivy

There is a newer version: 1.8
Show newest version

package z11;
/**
 *
 * @author vietduc
 */
public class L_ogger {
    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){
        L_ogger.print("123abcabcsdf");
        L_ogger.print("1");
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy