Put debug output behind ZT_TRACE

This commit is contained in:
Grant Limberg 2020-05-12 12:48:58 -07:00
parent c6518afa7a
commit aab96964b6
No known key found for this signature in database
GPG Key ID: 2BA62CCABBB4095A

View File

@ -157,7 +157,6 @@ PostgreSQL::~PostgreSQL()
_commitThread[i].join();
}
_onlineNotificationThread.join();
fprintf(stderr, "~PostgreSQL() done\n");
}
@ -739,14 +738,20 @@ void PostgreSQL::_membersWatcher_Redis() {
}
if (!result.empty()) {
for (auto element : result) {
#ifdef ZT_TRACE
fprintf(stdout, "Received notification from: %s\n", element.first.c_str());
#endif
for (auto rec : element.second) {
std::string id = rec.first;
auto attrs = rec.second;
#ifdef ZT_TRACE
fprintf(stdout, "Record ID: %s\n", id.c_str());
fprintf(stdout, "attrs len: %lu\n", attrs.size());
#endif
for (auto a : attrs) {
#ifdef ZT_TRACE
fprintf(stdout, "key: %s\nvalue: %s\n", a.first.c_str(), a.second.c_str());
#endif
try {
tmp = json::parse(a.second);
json &ov = tmp["old_val"];
@ -855,15 +860,20 @@ void PostgreSQL::_networksWatcher_Redis() {
if (!result.empty()) {
for (auto element : result) {
#ifdef ZT_TRACE
fprintf(stdout, "Received notification from: %s\n", element.first.c_str());
#endif
for (auto rec : element.second) {
std::string id = rec.first;
auto attrs = rec.second;
#ifdef ZT_TRACE
fprintf(stdout, "Record ID: %s\n", id.c_str());
fprintf(stdout, "attrs len: %lu\n", attrs.size());
#endif
for (auto a : attrs) {
#ifdef ZT_TRACE
fprintf(stdout, "key: %s\nvalue: %s\n", a.first.c_str(), a.second.c_str());
#endif
try {
tmp = json::parse(a.second);
json &ov = tmp["old_val"];