From aab96964b6ce93f452d0e170e969dd50a2ea2540 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Tue, 12 May 2020 12:48:58 -0700 Subject: [PATCH] Put debug output behind ZT_TRACE --- controller/PostgreSQL.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/controller/PostgreSQL.cpp b/controller/PostgreSQL.cpp index e3d513a06..505d76527 100644 --- a/controller/PostgreSQL.cpp +++ b/controller/PostgreSQL.cpp @@ -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"];