Browse Source

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

ignore-old-versions
CalDescent 3 years ago
parent
commit
f4520e2752
  1. 4
      src/main/java/org/qortal/block/Block.java

4
src/main/java/org/qortal/block/Block.java

@ -1998,6 +1998,10 @@ public class Block {
private void logDebugInfo() { private void logDebugInfo() {
try { 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) if (this.repository == null || this.getMinter() == null || this.getBlockData() == null)
return; return;

Loading…
Cancel
Save