Skip to content

Commit 7685869

Browse files
committed
dont spam log an exception
1 parent f05736d commit 7685869

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/main/java/mekanism/common/util/MekanismUtils.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import java.util.function.Supplier;
1919
import mekanism.api.Action;
2020
import mekanism.api.AutomationType;
21+
import mekanism.api.MekanismAPI;
2122
import mekanism.api.MekanismAPITags;
2223
import mekanism.api.Upgrade;
2324
import mekanism.api.chemical.IChemicalTank;
@@ -113,13 +114,19 @@ public final class MekanismUtils {
113114
// possible, and also ideally would use our normal logger instead of the API logger
114115
public static void logMismatchedStackSize(long actual, long expected) {
115116
if (expected != actual) {
116-
Mekanism.logger.error("Stack size changed by a different amount ({}) than requested ({}).", actual, expected, new Exception());
117+
Mekanism.logger.error("Stack size changed by a different amount ({}) than requested ({}).", actual, expected);
118+
if (MekanismAPI.debug) {
119+
Mekanism.logger.error("Location ", new Exception());
120+
}
117121
}
118122
}
119123

120124
public static void logExpectedZero(long actual) {
121125
if (actual != 0L) {
122-
Mekanism.logger.error("Energy value changed by a different amount ({}) than requested (zero).", actual, new Exception());
126+
Mekanism.logger.error("Energy value changed by a different amount ({}) than requested (zero).", actual);
127+
if (MekanismAPI.debug) {
128+
Mekanism.logger.error("Location ", new Exception());
129+
}
123130
}
124131
}
125132

0 commit comments

Comments
 (0)