package heufybot.core;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import heufybot.utils.FileUtils;

public class Logger 
{
	public static void log(String line, String target)
	{
		//Timestamp line
		DateFormat dateFormat = new SimpleDateFormat("[HH:mm]");
		Date date = new Date();
		
		//Output to console
		if(target.equals(""))
		{
			line = dateFormat.format(date) + " " + line;
		}
		else
		{
			line = dateFormat.format(date) + " " + target + " - " + line;
		}
		
		System.out.println(line);
		
		//Output to logfile
		FileUtils.writeFileAppend("test.log", line + "\n");
	}
	
	public static void log(String line)
	{
		log(line, "");
	}
	
	public static void error(String errorSource, String line)
	{
		System.err.println(errorSource + " - ERROR: " + line);
	}
}
@@ -751,27 +751,147 @@
 %7B%0A%09%09
-System.err.println(
+DateFormat dateFormat = new SimpleDateFormat(%22%5BHH:mm%5D%22);%0A%09%09Date date = new Date();%0A%09%09%0A%09%09System.err.println(dateFormat.format(date) + %22 %22 + 
 erro

Give errors a timestamp