Skip to content

Commit

Permalink
Improve debug log for ComponentTree
Browse files Browse the repository at this point in the history
Summary: As per the title, print a readable size spec string instead of a number that is hard to read.

Reviewed By: aashay-gaikwad

Differential Revision: D69531237

fbshipit-source-id: 48844ba95d964352d258c4b33e4e86bd60a11720
  • Loading branch information
Andrew Wang authored and facebook-github-bot committed Feb 12, 2025
1 parent 8cc7bd8 commit f030d8d
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions litho-core/src/main/java/com/facebook/litho/ComponentTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ public class ComponentTree
public static final int INVALID_ID = -1;
private static final String TAG = ComponentTree.class.getSimpleName();
public static final int SIZE_UNINITIALIZED = -1;
private static final String DEFAULT_RESOLVE_THREAD_NAME = "ComponentResolveThread";
/* package-private */ static final String DEFAULT_LAYOUT_THREAD_NAME = "ComponentLayoutThread";
private static final String EMPTY_STRING = "";
private static final String CT_CONTEXT_IS_DIFFERENT_FROM_ROOT_BUILDER_CONTEXT =
Expand Down Expand Up @@ -1012,9 +1011,9 @@ void measure(int widthSpec, int heightSpec, int[] measureOutput, boolean forceLa
debugLog(
"FinishMeasure",
"WidthSpec: "
+ View.MeasureSpec.toString(widthSpec)
+ SizeSpec.toSimpleString(widthSpec)
+ ", HeightSpec: "
+ View.MeasureSpec.toString(heightSpec)
+ SizeSpec.toSimpleString(heightSpec)
+ ", OutWidth: "
+ measureOutput[0]
+ ", OutHeight: "
Expand Down Expand Up @@ -1727,9 +1726,9 @@ private void setRootAndSizeSpecInternal(
+ ", Extra: "
+ extraAttribution
+ ", WidthSpec: "
+ View.MeasureSpec.toString(resolvedWidthSpec)
+ SizeSpec.toSimpleString(resolvedWidthSpec)
+ ", HeightSpec: "
+ View.MeasureSpec.toString(resolvedHeightSpec));
+ SizeSpec.toSimpleString(resolvedHeightSpec));
}

return;
Expand All @@ -1743,9 +1742,9 @@ private void setRootAndSizeSpecInternal(
+ ", Extra: "
+ extraAttribution
+ ", WidthSpec: "
+ View.MeasureSpec.toString(resolvedWidthSpec)
+ SizeSpec.toSimpleString(resolvedWidthSpec)
+ ", HeightSpec: "
+ View.MeasureSpec.toString(resolvedHeightSpec));
+ SizeSpec.toSimpleString(resolvedHeightSpec));
}

if (widthSpecInitialized) {
Expand Down Expand Up @@ -2411,9 +2410,9 @@ private void logFinishLayout(
+ ", Extra: "
+ extraAttribution
+ ", WidthSpec: "
+ View.MeasureSpec.toString(localLayoutState.getWidthSpec())
+ SizeSpec.toSimpleString(localLayoutState.getWidthSpec())
+ ", HeightSpec: "
+ View.MeasureSpec.toString(localLayoutState.getHeightSpec())
+ SizeSpec.toSimpleString(localLayoutState.getHeightSpec())
+ ", Width: "
+ localLayoutState.getWidth()
+ ", Height: "
Expand Down

0 comments on commit f030d8d

Please sign in to comment.