Drop debug lines before the platform binds

This commit is contained in:
piexel committed 2026-11-18 22:07:57 +01:00
1 parent 7c31231a77
commit 3b9cb4ce91
2 files changed
+28

No files matched your search

@@ -6,6 +6,9 @@ import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
@@ -71,6 +74,22 @@ public class IrisLoggingTest {
assertEquals("chunk=3,7", messages.getFirst());
}
@Test
public void debugIsDroppedWhenNoPlatformCanSayDebugIsOn() {
IrisPlatforms.unbind();
ByteArrayOutputStream captured = new ByteArrayOutputStream();
PrintStream originalOut = System.out;
System.setOut(new PrintStream(captured, true, StandardCharsets.UTF_8));
try {
IrisLogging.debug("Loader<Biome> iload plains");
IrisLogging.info("visible");
} finally {
System.setOut(originalOut);
}
assertEquals("[Iris/INFO] visible" + System.lineSeparator(), captured.toString(StandardCharsets.UTF_8));
}
@Test
public void contextualReportUsesThePlatformReporterWithoutADuplicateLogLine() {
RuntimeException failure = new RuntimeException("broken");