/*
 */
package com.infinityraider.agricraft.core;

import com.agricraft.agricore.log.AgriLogAdapter;
import java.text.MessageFormat;
import net.minecraftforge.fml.common.FMLLog;
import org.apache.logging.log4j.Level;

/**
 *
 * @author RlonRyan
 */
public class ModLogger implements AgriLogAdapter {
	
	public void log(Level logLevel, Object source, String format, Object... objects) {
		FMLLog.log(String.valueOf(source), logLevel, MessageFormat.format(format, objects));
	}
	
	@Override
	public void all(Object source, String format, Object... objects) {
        log(Level.ALL, source, format, objects);
    }

	@Override
	public void debug(Object source, String format, Object... objects) {
        log(Level.INFO, source, "[AGRI-DEBUG]: " + format, objects);
	}

	@Override
	public void trace(Object source, Exception e) {
		debug(source, "{0}", e);
	}

	@Override
	public void error(Object source, String format, Object... objects) {
		log(Level.ERROR, source, format, objects);
	}

	@Override
	public void info(Object source, String format, Object... objects) {
		log(Level.INFO, source, format, objects);
	}

	@Override
	public void warn(Object source, String format, Object... objects) {
		log(Level.WARN, source, format, objects);
	}

	@Override
	public void severe(Object source, String format, Object... objects) {
		log(Level.FATAL, source, format, objects);
	}
	
}

@@ -293,18 +293,17 @@
 apter %7B%0A
-%09
 %0A
+
 %09public 
@@ -378,16 +378,25 @@
 ects) %7B%0A
+%09%09try %7B%0A%09
 %09%09FMLLog
@@ -474,21 +474,144 @@
 ects));%0A
+%09%09%7D catch (IllegalArgumentException ex) %7B%0A%09%09%09// This is bad...%0A%09%09%09FMLLog.log(String.valueOf(source), logLevel, format);%0A%09%09%7D%0A
 %09%7D%0A
-%09
 %0A
+
 %09@Overri
@@ -677,32 +677,26 @@
  objects) %7B%0A
-        
+%09%09
 log(Level.AL
@@ -724,20 +724,17 @@
 jects);%0A
-    
+%09
 %7D%0A%0A%09@Ove
@@ -813,16 +813,10 @@
 ) %7B%0A
-        
+%09%09
 log(
@@ -1483,12 +1483,11 @@
 ts);%0A%09%7D%0A
-%09
 %0A%7D%0A

Patch Mod Log Provider