From 5642514aa52e3b1afc2a59e9bf4bba604a9aaa16 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Sun, 25 Mar 2018 22:43:36 -0700 Subject: [PATCH] Fabric: Detailed looging in FabricUIManager Summary: Apparently, we need this. Reviewed By: mdvacca Differential Revision: D7376350 fbshipit-source-id: 11d8ad54c7439e6c19a739ae1ac31af90d37166a --- .../fabric/uimanager/FabricUIManager.cpp | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/ReactCommon/fabric/uimanager/FabricUIManager.cpp b/ReactCommon/fabric/uimanager/FabricUIManager.cpp index 14adad47c..997a5a91b 100644 --- a/ReactCommon/fabric/uimanager/FabricUIManager.cpp +++ b/ReactCommon/fabric/uimanager/FabricUIManager.cpp @@ -45,51 +45,69 @@ FabricUIManager::FabricUIManager(const std::shared_ptr " << shadowNode->getDebugDescription(DebugStringConvertibleOptions {.format = false}); return shadowNode; } SharedShadowNode FabricUIManager::cloneNode(const SharedShadowNode &shadowNode) { + LOG(INFO) << "FabricUIManager::cloneNode(shadowNode: " << shadowNode->getDebugDescription(DebugStringConvertibleOptions {.format = false}) << ")"; ComponentDescriptor &componentDescriptor = *_registry[shadowNode]; - return componentDescriptor.cloneShadowNode(shadowNode); + SharedShadowNode clonnedShadowNode = componentDescriptor.cloneShadowNode(shadowNode); + LOG(INFO) << "FabricUIManager::cloneNode() -> " << clonnedShadowNode->getDebugDescription(DebugStringConvertibleOptions {.format = false}); + return clonnedShadowNode; } SharedShadowNode FabricUIManager::cloneNodeWithNewChildren(const SharedShadowNode &shadowNode) { + LOG(INFO) << "FabricUIManager::cloneNodeWithNewChildren(shadowNode: " << shadowNode->getDebugDescription(DebugStringConvertibleOptions {.format = false}) << ")"; // Assuming semantic: Cloning with same props but empty children. ComponentDescriptor &componentDescriptor = *_registry[shadowNode]; - return componentDescriptor.cloneShadowNode(shadowNode, nullptr, {}); + SharedShadowNode clonnedShadowNode = componentDescriptor.cloneShadowNode(shadowNode, nullptr, {}); + LOG(INFO) << "FabricUIManager::cloneNodeWithNewChildren() -> " << clonnedShadowNode->getDebugDescription(DebugStringConvertibleOptions {.format = false}); + return clonnedShadowNode; } SharedShadowNode FabricUIManager::cloneNodeWithNewProps(const SharedShadowNode &shadowNode, folly::dynamic props) { + LOG(INFO) << "FabricUIManager::cloneNodeWithNewProps(shadowNode: " << shadowNode->getDebugDescription(DebugStringConvertibleOptions {.format = false}) << ", props: " << props << ")"; // Assuming semantic: Cloning with same children and specified props. ComponentDescriptor &componentDescriptor = *_registry[shadowNode]; RawProps rawProps = rawPropsFromDynamic(props); - return componentDescriptor.cloneShadowNode(shadowNode, std::make_shared(rawProps), nullptr); + SharedShadowNode clonnedShadowNode = componentDescriptor.cloneShadowNode(shadowNode, std::make_shared(rawProps), nullptr); + LOG(INFO) << "FabricUIManager::cloneNodeWithNewProps() -> " << clonnedShadowNode->getDebugDescription(DebugStringConvertibleOptions {.format = false}); + return clonnedShadowNode; } SharedShadowNode FabricUIManager::cloneNodeWithNewChildrenAndProps(const SharedShadowNode &shadowNode, folly::dynamic props) { + LOG(INFO) << "FabricUIManager::cloneNodeWithNewChildrenAndProps(shadowNode: " << shadowNode->getDebugDescription(DebugStringConvertibleOptions {.format = false}) << ", props: " << props << ")"; // Assuming semantic: Cloning with empty children and specified props. ComponentDescriptor &componentDescriptor = *_registry[shadowNode]; RawProps rawProps = rawPropsFromDynamic(props); - return componentDescriptor.cloneShadowNode(shadowNode, std::make_shared(rawProps), {}); + SharedShadowNode clonnedShadowNode = componentDescriptor.cloneShadowNode(shadowNode, std::make_shared(rawProps), {}); + LOG(INFO) << "FabricUIManager::cloneNodeWithNewChildrenAndProps() -> " << clonnedShadowNode->getDebugDescription(DebugStringConvertibleOptions {.format = false}); + return clonnedShadowNode; } void FabricUIManager::appendChild(const SharedShadowNode &parentShadowNode, const SharedShadowNode &childShadowNode) { + LOG(INFO) << "FabricUIManager::appendChild(parentShadowNode: " << parentShadowNode->getDebugDescription(DebugStringConvertibleOptions {.format = false}) << ", childShadowNode: " << childShadowNode->getDebugDescription(DebugStringConvertibleOptions {.format = false}) << ")"; ComponentDescriptor &componentDescriptor = *_registry[parentShadowNode]; componentDescriptor.appendChild(parentShadowNode, childShadowNode); } SharedShadowNodeUnsharedList FabricUIManager::createChildSet(int rootTag) { + LOG(INFO) << "FabricUIManager::createChildSet(rootTag: " << rootTag << ")"; return std::make_shared(SharedShadowNodeList({})); } void FabricUIManager::appendChildToSet(const SharedShadowNodeUnsharedList &shadowNodeList, const SharedShadowNode &shadowNode) { + LOG(INFO) << "FabricUIManager::appendChildToSet(shadowNodeList: " << shadowNodeList << ", shadowNode: " << shadowNode->getDebugDescription(DebugStringConvertibleOptions {.format = false}) << ")"; shadowNodeList->push_back(shadowNode); } void FabricUIManager::completeRoot(int rootTag, const SharedShadowNodeUnsharedList &children) { + LOG(INFO) << "FabricUIManager::appendChildToSet(rootTag: " << rootTag << ", shadowNodeList: " << children << ")"; ComponentDescriptor &componentDescriptor = *_registry["View"]; SharedShadowNode previousRootShadowNode = componentDescriptor.createShadowNode(rootTag, rootTag, nullptr, {}); auto childrenCopy = std::make_shared(SharedShadowNodeList(*children));