in og/shared/src/main/java/com/google/idea/blaze/common/PrintOutput.java [23:72]
public record PrintOutput(@Nonnull String text, @Nonnull OutputType outputType) implements Output {
/** The output type */
public enum OutputType {
NORMAL,
LOGGED,
ERROR,
PROCESS
}
public PrintOutput(@Nonnull String text) {
this(text, OutputType.NORMAL);
}
@Override
public String toString() {
return text();
}
public static PrintOutput output(String text) {
return new PrintOutput(text);
}
@FormatMethod
public static PrintOutput output(@FormatString String text, Object... args) {
return new PrintOutput(String.format(text, args));
}
public static PrintOutput log(String text) {
return new PrintOutput(text, OutputType.LOGGED);
}
@FormatMethod
public static PrintOutput log(@FormatString String text, Object... args) {
return new PrintOutput(String.format(text, args), OutputType.LOGGED);
}
public static PrintOutput error(String text) {
return new PrintOutput(text, OutputType.ERROR);
}
@FormatMethod
public static PrintOutput error(@FormatString String text, Object... args) {
return new PrintOutput(String.format(text, args), OutputType.ERROR);
}
public static PrintOutput process(String text) {
return new PrintOutput(text, OutputType.PROCESS);
}
}