icecream-java is a Java port of the icecream library for Python.
<dependency>
<groupId>io.github.akshay-thakare</groupId>
<artifactId>icecream</artifactId>
<version>0.1.3</version>
</dependency>
Static import import static org.icecream.IceCream.ic;
for ease of use.
ic()
Prints
🍦org.icecream.IceCreamTest > simplePrintTest:L24
ic(1, 2, 3);
ic(concat("1", "2"));
String concat(String a, String b) {
return a + b;
}
Prints
🍦org.icecream.IceCreamTest > withParamsTest:L25 > param_0 = 1 | param_1 = 2 | param_2 = 3
🍦org.icecream.IceCreamTest > withMethodAsParamTest:L33 > param_0 = 12
IceCream.setPrefix("icc |");
This will disable printing of file name, class name, method name and line number.
IceCream.includeContext(false);
IceCream.includeFilename(false);
IceCream.includeClassName(false);
IceCream.includeMethodNameAndLineNumber(false);