mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-19 21:17:52 +00:00
Put debug output behind ZT_TRACE
This commit is contained in:
parent
c6518afa7a
commit
aab96964b6
@ -157,7 +157,6 @@ PostgreSQL::~PostgreSQL()
|
|||||||
_commitThread[i].join();
|
_commitThread[i].join();
|
||||||
}
|
}
|
||||||
_onlineNotificationThread.join();
|
_onlineNotificationThread.join();
|
||||||
fprintf(stderr, "~PostgreSQL() done\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -739,14 +738,20 @@ void PostgreSQL::_membersWatcher_Redis() {
|
|||||||
}
|
}
|
||||||
if (!result.empty()) {
|
if (!result.empty()) {
|
||||||
for (auto element : result) {
|
for (auto element : result) {
|
||||||
|
#ifdef ZT_TRACE
|
||||||
fprintf(stdout, "Received notification from: %s\n", element.first.c_str());
|
fprintf(stdout, "Received notification from: %s\n", element.first.c_str());
|
||||||
|
#endif
|
||||||
for (auto rec : element.second) {
|
for (auto rec : element.second) {
|
||||||
std::string id = rec.first;
|
std::string id = rec.first;
|
||||||
auto attrs = rec.second;
|
auto attrs = rec.second;
|
||||||
|
#ifdef ZT_TRACE
|
||||||
fprintf(stdout, "Record ID: %s\n", id.c_str());
|
fprintf(stdout, "Record ID: %s\n", id.c_str());
|
||||||
fprintf(stdout, "attrs len: %lu\n", attrs.size());
|
fprintf(stdout, "attrs len: %lu\n", attrs.size());
|
||||||
|
#endif
|
||||||
for (auto a : attrs) {
|
for (auto a : attrs) {
|
||||||
|
#ifdef ZT_TRACE
|
||||||
fprintf(stdout, "key: %s\nvalue: %s\n", a.first.c_str(), a.second.c_str());
|
fprintf(stdout, "key: %s\nvalue: %s\n", a.first.c_str(), a.second.c_str());
|
||||||
|
#endif
|
||||||
try {
|
try {
|
||||||
tmp = json::parse(a.second);
|
tmp = json::parse(a.second);
|
||||||
json &ov = tmp["old_val"];
|
json &ov = tmp["old_val"];
|
||||||
@ -855,15 +860,20 @@ void PostgreSQL::_networksWatcher_Redis() {
|
|||||||
|
|
||||||
if (!result.empty()) {
|
if (!result.empty()) {
|
||||||
for (auto element : result) {
|
for (auto element : result) {
|
||||||
|
#ifdef ZT_TRACE
|
||||||
fprintf(stdout, "Received notification from: %s\n", element.first.c_str());
|
fprintf(stdout, "Received notification from: %s\n", element.first.c_str());
|
||||||
|
#endif
|
||||||
for (auto rec : element.second) {
|
for (auto rec : element.second) {
|
||||||
std::string id = rec.first;
|
std::string id = rec.first;
|
||||||
auto attrs = rec.second;
|
auto attrs = rec.second;
|
||||||
|
#ifdef ZT_TRACE
|
||||||
fprintf(stdout, "Record ID: %s\n", id.c_str());
|
fprintf(stdout, "Record ID: %s\n", id.c_str());
|
||||||
fprintf(stdout, "attrs len: %lu\n", attrs.size());
|
fprintf(stdout, "attrs len: %lu\n", attrs.size());
|
||||||
|
#endif
|
||||||
for (auto a : attrs) {
|
for (auto a : attrs) {
|
||||||
|
#ifdef ZT_TRACE
|
||||||
fprintf(stdout, "key: %s\nvalue: %s\n", a.first.c_str(), a.second.c_str());
|
fprintf(stdout, "key: %s\nvalue: %s\n", a.first.c_str(), a.second.c_str());
|
||||||
|
#endif
|
||||||
try {
|
try {
|
||||||
tmp = json::parse(a.second);
|
tmp = json::parse(a.second);
|
||||||
json &ov = tmp["old_val"];
|
json &ov = tmp["old_val"];
|
||||||
|
Loading…
Reference in New Issue
Block a user