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)
	{
		//Timestamp line
		DateFormat dateFormat = new SimpleDateFormat("[HH:mm]");
		Date date = new Date();
		line = dateFormat.format(date) + " " + line;
		
		//Output to console
		System.out.println(line);
		
		//Output to logfile
		FileUtils.writeFileAppend("test.log", line + "\n");
	}
	
	public static void error(String errorSource, String line)
	{
		System.err.println(errorSource + " - ERROR: " + line);
	}
}
@@ -193,24 +193,39 @@
 (String line
+, String target
 )%0A%09%7B%0A%09%09//Tim
@@ -399,33 +399,127 @@
 e%0A%09%09
-System.out.println(line);
+if(target.equals(%22%22))%0A%09%09%7B%0A%09%09%09System.out.println(line);%0A%09%09%7D%0A%09%09else%0A%09%09%7B%0A%09%09%09System.out.println(target + %22 - %22 + line);%0A%09%09%7D
 %0A%09%09%0A
@@ -599,16 +599,78 @@
 );%0A%09%7D%0A%09%0A
+%09public static void log(String line)%0A%09%7B%0A%09%09log(line, %22%22);%0A%09%7D%0A%09%0A
 %09public 

Add logging to a target, for creating logfiles for seperate channels later