Fabric: New nice way to deal with DebugStringConvertible items

Summary:
No macros in product code.
(Not all callsites are converted yet.)

Reviewed By: mdvacca

Differential Revision: D7797561

fbshipit-source-id: da899421bf99669a0e0a2b83df6004daf14355c2
This commit is contained in:
Valentin Shergin
2018-05-08 22:56:02 -07:00
committed by Facebook Github Bot
parent d9ff1769aa
commit 6e537b000b
11 changed files with 198 additions and 60 deletions

View File

@@ -18,6 +18,10 @@ std::string DebugStringConvertible::getDebugChildrenDescription(DebugStringConve
std::string childrenString = "";
for (auto child : getDebugChildren()) {
if (!child) {
continue;
}
childrenString += child->getDebugDescription(options, depth + 1);
}
@@ -32,6 +36,10 @@ std::string DebugStringConvertible::getDebugPropsDescription(DebugStringConverti
std::string propsString = "";
for (auto prop : getDebugProps()) {
if (!prop) {
continue;
}
auto name = prop->getDebugName();
auto value = prop->getDebugValue();
auto children = prop->getDebugPropsDescription(options, depth + 1);