Skip Block.logDebugInfo() altogether if the log level is more specific than DEBUG, to avoid wasting resources.

This commit is contained in:
CalDescent 2021-05-09 09:00:53 +01:00
parent d2ea5633fb
commit 68544715bf

View File

@ -2010,6 +2010,10 @@ public class Block {
private void logDebugInfo() {
try {
// Avoid calculations if possible. We have to check against INFO here, since Level.isMoreSpecificThan() confusingly uses <= rather than just <
if (LOGGER.getLevel().isMoreSpecificThan(Level.INFO))
return;
if (this.repository == null || this.getMinter() == null || this.getBlockData() == null)
return;