Skip to content

Commit

Permalink
fix issue 1672 (inefficient logging in Node.java) (#1673)
Browse files Browse the repository at this point in the history
* #1672 Logging statements should be guarded

* #1672 Fix performance penalty of logger without guard

Co-authored-by: Cédric de Launois <>
  • Loading branch information
vxel authored and stephengold committed Dec 4, 2021
1 parent b0018f4 commit 662c8fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jme3-core/src/main/java/com/jme3/scene/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ public Spatial detachChildAt(int index) {
Spatial child = children.remove(index);
if (child != null) {
child.setParent(null);
logger.log(Level.FINE, "{0}: Child removed.", this.toString());
logger.log(Level.FINE, "{0}: Child removed.", this);

// since a child with a bound was detached;
// our own bound will probably change.
Expand Down Expand Up @@ -461,7 +461,7 @@ public void detachAllChildren() {
for (int i = children.size() - 1; i >= 0; i--) {
detachChildAt(i);
}
logger.log(Level.FINE, "{0}: All children removed.", this.toString());
logger.log(Level.FINE, "{0}: All children removed.", this);
}

/**
Expand Down

0 comments on commit 662c8fe

Please sign in to comment.