Skip to content
Snippets Groups Projects
Commit 3700eb1d authored by Vojtech Moravec's avatar Vojtech Moravec
Browse files

Add printf to ColorConsole

parent a2eceaa5
No related branches found
No related tags found
No related merge requests found
......@@ -36,14 +36,22 @@ public final class ColorConsole {
}
}
public static void printf(final Color color, final String format, final Object... args) {
fprintf(Target.stdout, color, String.format(format, args));
}
public static void fprintf(final Target target, final Color color, final String format, final Object... args) {
fprintf(target, color, String.format(format, args));
}
public static void fprintf(final Target target, final Color color, final String string) {
switch (target) {
case stdout:
System.out.println(getColor(color) + String.format(format, args) + ANSI_RESET);
System.out.println(getColor(color) + string + ANSI_RESET);
break;
case stderr:
System.err.println(getColor(color) + String.format(format, args) + ANSI_RESET);
System.err.println(getColor(color) + string + ANSI_RESET);
break;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment