package net.minecraft.gametest.framework;

import org.apache.logging.log4j.LogManager;
import net.minecraft.Util;
import org.apache.logging.log4j.Logger;

public class LogTestReporter implements TestReporter {
    private static final Logger LOGGER;
    
    @Override
    public void onTestFailed(final GameTestInfo iw) {
        if (iw.isRequired()) {
            LogTestReporter.LOGGER.error(iw.getTestName() + " failed! " + Util.describeError(iw.getError()));
        }
        else {
            LogTestReporter.LOGGER.warn("(optional) " + iw.getTestName() + " failed. " + Util.describeError(iw.getError()));
        }
    }
    
    static {
        LOGGER = LogManager.getLogger();
    }
}
