Skip to content

Commit ca9a2a3

Browse files
committed
Allow saving and setting log indentation
1 parent 615eb93 commit ca9a2a3

File tree

1 file changed

+9
-2
lines changed
  • log-utils/src/main/java/net/minecraftforge/util/logging

1 file changed

+9
-2
lines changed

log-utils/src/main/java/net/minecraftforge/util/logging/Log.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ private static PrintStream streamOf(Level level, PrintStream delegate) {
5858
private static byte indent = 0;
5959

6060
/** Pushes the current indentation level up by one. */
61-
public static void push() {
62-
indent++;
61+
public static int push() {
62+
return ++indent;
6363
}
6464

6565
/**
@@ -72,6 +72,13 @@ public static void pop() {
7272
throw new IllegalStateException("Cannot pop logger below 0");
7373
}
7474

75+
public static void setIndent(byte indent) {
76+
if (indent < 0)
77+
throw new IllegalStateException("Cannot pop logger below 0");
78+
79+
Log.indent = indent;
80+
}
81+
7582
static String getIndentation() {
7683
if (indent == 0) return "";
7784

0 commit comments

Comments
 (0)