Print ShadowView hash when displaying instructions

Summary:
When displaying instructions in debug logs, also print ShadowView hash to make it easier to reconstruct a series of events.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D27492938

fbshipit-source-id: 276a080a4afcfb4aa0aafc215e2ccd56ef849fcf
This commit is contained in:
Joshua Gross
2021-03-31 21:33:06 -07:00
committed by Facebook GitHub Bot
parent 638e788e06
commit e9ff6d8bca
@@ -60,8 +60,19 @@ static std::string GetMutationInstructionString(
void PrintMutationInstruction(
std::string message,
ShadowViewMutation const &mutation) {
LOG(ERROR) << message
<< " Mutation: " << GetMutationInstructionString(mutation);
[&](std::ostream &stream) -> std::ostream & {
stream << message
<< " Mutation: " << GetMutationInstructionString(mutation);
if (mutation.oldChildShadowView.tag != 0) {
stream << " old hash: ##"
<< std::hash<ShadowView>{}(mutation.oldChildShadowView);
}
if (mutation.newChildShadowView.tag != 0) {
stream << " new hash: ##"
<< std::hash<ShadowView>{}(mutation.newChildShadowView);
}
return stream;
}(LOG(ERROR));
}
void PrintMutationInstructionRelative(
std::string message,