LogTestReporter .java

net.minecraft.gametest.framework.LogTestReporter (class, 24 lines): implements TestReporter. members: onTestSuccess, onTestFailed, LOGGER. imports: Util.

net.minecraft.gametest.frameworkclass24 linescommon743 B

Implements

API Surface (2)

void onTestFailed(final GameTestInfo testInfo)
void onTestSuccess(final GameTestInfo testInfo)

Fields & Constants (1)

LOGGER

Code Graph: Dependencies (3)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

LogTestReporter.java24 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.gametest.framework;
2
3
import com.mojang.logging.LogUtils;
4
import net.minecraft.util.Util;
5
import org.slf4j.Logger;
6
7
public class LogTestReporter implements TestReporter {
8
	private static final Logger LOGGER = LogUtils.getLogger();
9
10
	@Override
11
	public void onTestFailed(final GameTestInfo testInfo) {
12
		String testPosition = testInfo.getTestBlockPos().toShortString();
13
		if (testInfo.isRequired()) {
14
			LOGGER.error("{} failed at {}! {}", testInfo.id(), testPosition, Util.describeError(testInfo.getError()));
15
		} else {
16
			LOGGER.warn("(optional) {} failed at {}. {}", testInfo.id(), testPosition, Util.describeError(testInfo.getError()));
17
		}
18
	}
19
20
	@Override
21
	public void onTestSuccess(final GameTestInfo testInfo) {
22
	}
23
}
24

Decompiled Minecraft 26.3 source of LogTestReporter (net/minecraft/gametest/framework/LogTestReporter.java) with Mojang official mappings, stored verbatim on the site.