Skip to content

Commit

Permalink
chore: Reduce the amount of logs
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach committed Dec 24, 2024
1 parent 95decc0 commit 84f0963
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,11 @@ private List<UiElementSnapshot> buildChildren(AccessibilityNodeInfo node) {

List<UiElementSnapshot> children = new ArrayList<>(childCount);
boolean areInvisibleElementsAllowed = Settings.get(AllowInvisibleElements.class).getValue();
List<Integer> nullNodeIndexes = new ArrayList<>();
for (int index = 0; index < childCount; ++index) {
AccessibilityNodeInfo child = node.getChild(index);
if (child == null) {
Logger.info(String.format("The child node #%s of %s is null", index, node));
nullNodeIndexes.add(index);
continue;
}

Expand All @@ -253,6 +254,11 @@ private List<UiElementSnapshot> buildChildren(AccessibilityNodeInfo node) {
children.add(take(child, index, depth + 1, includedAttributes));
}
}
if (!nullNodeIndexes.isEmpty()) {
Logger.info(String.format(
"The following child nodes of %s are nulls: %s", node, nullNodeIndexes
));
}
return children;
}

Expand Down

0 comments on commit 84f0963

Please sign in to comment.