diff --git a/ReactCommon/fabric/mounting/MountingCoordinator.cpp b/ReactCommon/fabric/mounting/MountingCoordinator.cpp index 72ed5637cf7..d0bf0dc2fb0 100644 --- a/ReactCommon/fabric/mounting/MountingCoordinator.cpp +++ b/ReactCommon/fabric/mounting/MountingCoordinator.cpp @@ -9,6 +9,7 @@ #ifdef RN_SHADOW_TREE_INTROSPECTION #include +#include #endif #include @@ -89,20 +90,27 @@ better::optional MountingCoordinator::pullTransaction() stubViewTree_.mutate(mutations); auto stubViewTree = stubViewTreeFromShadowNode(lastRevision_->getRootShadowNode()); - if (stubViewTree_ != stubViewTree) { - LOG(ERROR) << "Old tree:" - << "\n" - << baseRevision_.getRootShadowNode().getDebugDescription() - << "\n"; - LOG(ERROR) << "New tree:" - << "\n" - << lastRevision_->getRootShadowNode().getDebugDescription() - << "\n"; - LOG(ERROR) << "Mutations:" - << "\n" - << getDebugDescription(mutations, {}); - assert(false); + + std::string line; + + std::stringstream ssOldTree( + baseRevision_.getRootShadowNode().getDebugDescription()); + while (std::getline(ssOldTree, line, '\n')) { + LOG(ERROR) << "Old tree:" << line; } + + std::stringstream ssNewTree( + lastRevision_->getRootShadowNode().getDebugDescription()); + while (std::getline(ssNewTree, line, '\n')) { + LOG(ERROR) << "New tree:" << line; + } + + std::stringstream ssMutations(getDebugDescription(mutations, {})); + while (std::getline(ssMutations, line, '\n')) { + LOG(ERROR) << "Mutations:" << line; + } + + assert(stubViewTree_ == stubViewTree); #endif baseRevision_ = std::move(*lastRevision_);