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 kg) {
        if (kg.isRequired()) {
            LogTestReporter.LOGGER.error(kg.getTestName() + " failed! " + Util.describeError(kg.getError()));
        }
        else {
            LogTestReporter.LOGGER.warn("(optional) " + kg.getTestName() + " failed. " + Util.describeError(kg.getError()));
        }
    }
    
    static {
        LOGGER = LogManager.getLogger();
    }
}
