Exclude logging functionality outside debug builds
Summary: Don't compile in YGNodePrint in production builds Reviewed By: davidaurelio Differential Revision: D14258269 fbshipit-source-id: 15b5e94d241a752fea74a45263aa343265071451
This commit is contained in:
committed by
Facebook Github Bot
parent
0d96098fd9
commit
14f3827491
@@ -979,6 +979,7 @@ bool YGLayoutNodeInternal(
|
||||
YGMarkerLayoutData& layoutMarkerData,
|
||||
void* const layoutContext);
|
||||
|
||||
#ifdef DEBUG
|
||||
static void YGNodePrintInternal(
|
||||
const YGNodeRef node,
|
||||
const YGPrintOptions options) {
|
||||
@@ -990,6 +991,7 @@ static void YGNodePrintInternal(
|
||||
void YGNodePrint(const YGNodeRef node, const YGPrintOptions options) {
|
||||
YGNodePrintInternal(node, options);
|
||||
}
|
||||
#endif
|
||||
|
||||
const std::array<YGEdge, 4> leading = {
|
||||
{YGEdgeTop, YGEdgeBottom, YGEdgeLeft, YGEdgeRight}};
|
||||
@@ -4091,6 +4093,7 @@ void YGNodeCalculateLayoutWithContext(
|
||||
node->getLayout().direction, ownerWidth, ownerHeight, ownerWidth);
|
||||
YGRoundToPixelGrid(node, node->getConfig()->pointScaleFactor, 0.0f, 0.0f);
|
||||
|
||||
#ifdef DEBUG
|
||||
if (node->getConfig()->printTree) {
|
||||
YGNodePrint(
|
||||
node,
|
||||
@@ -4098,6 +4101,7 @@ void YGNodeCalculateLayoutWithContext(
|
||||
YGPrintOptionsLayout | YGPrintOptionsChildren |
|
||||
YGPrintOptionsStyle));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// We want to get rid off `useLegacyStretchBehaviour` from YGConfig. But we
|
||||
@@ -4147,6 +4151,7 @@ void YGNodeCalculateLayoutWithContext(
|
||||
!originalNode->isLayoutTreeEqualToNode(*node);
|
||||
node->setLayoutDoesLegacyFlagAffectsLayout(neededLegacyStretchBehaviour);
|
||||
|
||||
#ifdef DEBUG
|
||||
if (originalNode->getConfig()->printTree) {
|
||||
YGNodePrint(
|
||||
originalNode,
|
||||
@@ -4154,6 +4159,7 @@ void YGNodeCalculateLayoutWithContext(
|
||||
YGPrintOptionsLayout | YGPrintOptionsChildren |
|
||||
YGPrintOptionsStyle));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
YGConfigFreeRecursive(originalNode);
|
||||
YGNodeFreeRecursive(originalNode);
|
||||
|
Reference in New Issue
Block a user