/*
 * Copyright (C) 2017 Clivern. <https://clivern.com>
 */
package com.clivern.racter.utils;

import java.io.IOException;
import java.util.logging.ConsoleHandler;
import java.util.logging.FileHandler;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * Logger Utils Class
 *
 * <code>
 * import com.clivern.racter.utils.Log;
 * import java.util.logging.Level;
 *
 * Log log_handle = Log.getInstance();
 * log_handle.config(true, Level.ALL, true, Level.ALL, "src/main/java/resources/app.log");
 * log_handle.getLogger().warning("warning MSG");
 * log_handle.getLogger().severe("severe MSG");
 * log_handle.close();
 * </code>
 * @since 1.0.0
 */
public class Log {

	private static final Logger LOGGER = Logger.getLogger("com.clivern.racter");
	private static Log instance = null;
	private static Handler consoleHandler = null;
	private static Handler fileHandler = null;

	protected Log() { }

	public static Log getInstance() {
	    if(instance == null) {
	        instance = new Log();
	    }
	    return instance;
	}

	public static Log config(Boolean console_handler_status, Level console_handler_level, Boolean file_handler_status, Level file_handler_level, String file_path) throws IOException
	{
		if( console_handler_status ){
			consoleHandler = new ConsoleHandler();
			LOGGER.addHandler(consoleHandler);
			consoleHandler.setLevel(console_handler_level);
		}

		if( file_handler_status ){
			fileHandler  = new FileHandler(file_path, 50000000, 1, true);
			LOGGER.addHandler(fileHandler);
			fileHandler.setLevel(file_handler_level);
		}

		return instance;
	}

	public static Logger getLogger()
	{
		return LOGGER;
	}

	public static void close()
	{
		if( fileHandler != null ){
			fileHandler.close();
		}
	}

}
@@ -926,28 +926,101 @@
 ;%0A%0A%09
-protected Log() %7B %7D%0A
+/**%0A%09 * Constructor%0A%09 */%0A%09protected Log() %7B %7D%0A%0A%09/**%0A%09 * Get Instance%0A%09 *%0A%09 * @return Log%0A%09 */
 %0A%09pu
@@ -1135,32 +1135,258 @@
 n instance;%0A%09%7D%0A%0A
+%09/**%0A%09 * Config Logger%0A%09 *%0A%09 * @param  console_handler_status%0A%09 * @param  console_handler_level%0A%09 * @param  file_handler_status%0A%09 * @param  file_handler_level%0A%09 * @param  file_path%0A%09 * @return Log%0A%09 * @throws IOException%0A%09 */%0A
 %09public static L
@@ -1917,24 +1917,72 @@
 stance;%0A%09%7D%0A%0A
+%09/**%0A%09 * Get Logger%0A%09 *%0A%09 * @return Logger%0A%09 */%0A
 %09public stat
@@ -2027,16 +2027,49 @@
 ER;%0A%09%7D%0A%0A
+%09/**%0A%09 * Close File Handler%0A%09 */%0A
 %09public 

add doc blocks to logger