diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-06-28 01:17:37 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-06-28 01:17:37 +0300 |
commit | e7d14c637a4884a5937b00791416dcf72a03a862 (patch) | |
tree | 747836c2b034a400bc74fb0c882ed79bb2933f78 /src | |
parent | d4b20cc2bab70016ba7ba40bab8937ab680ef7b8 (diff) | |
download | paranucker-e7d14c637a4884a5937b00791416dcf72a03a862.tar.gz paranucker-e7d14c637a4884a5937b00791416dcf72a03a862.tar.bz2 paranucker-e7d14c637a4884a5937b00791416dcf72a03a862.tar.xz paranucker-e7d14c637a4884a5937b00791416dcf72a03a862.zip |
Improve debug logging.
Diffstat (limited to 'src')
-rw-r--r-- | src/logger.cpp | 55 |
1 files changed, 32 insertions, 23 deletions
diff --git a/src/logger.cpp b/src/logger.cpp index 45d78d2..0b54e4c 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -193,12 +193,15 @@ void dumpAttr(const Node *const node, int num, bool isReturned) } #define dumpWIProps(comment, name) \ - Log::log(comment); \ - FOR_EACH (StringSet::const_iterator, \ - it, \ - name) \ + if (!(name).empty()) \ { \ - Log::log("%s, ", (*it).c_str()); \ + Log::log(comment); \ + FOR_EACH (StringSet::const_iterator, \ + it, \ + name) \ + { \ + Log::log("%s, ", (*it).c_str()); \ + } \ } void dumpWI(Node *const node, @@ -223,29 +226,35 @@ void dumpWI(Node *const node, dumpWIProps(" removeNullVars:", wi.removeNullVars) dumpWIProps(" addNullVars:", wi.addNullVars) - Log::log(" linkedVars:"); - FOR_EACH (StringMapSet::const_iterator, - it, - wi.linkedVars) + if (!wi.linkedVars.empty()) { - Log::log("%s -> (", ((*it).first).c_str()); - const StringSet &vars = (*it).second; - FOR_EACH (StringSet::const_iterator, - it2, - vars) + Log::log(" linkedVars:"); + FOR_EACH (StringMapSet::const_iterator, + it, + wi.linkedVars) { - Log::log("%s, ", (*it2).c_str()); + Log::log("%s -> (", ((*it).first).c_str()); + const StringSet &vars = (*it).second; + FOR_EACH (StringSet::const_iterator, + it2, + vars) + { + Log::log("%s, ", (*it2).c_str()); + } + Log::log("), "); } - Log::log("), "); } - Log::log(" linkedReverseVars:"); - FOR_EACH (StringMap::const_iterator, - it, - wi.linkedReverseVars) + if (!wi.linkedReverseVars.empty()) { - Log::log("%s -> %s ", - ((*it).first).c_str(), - ((*it).second).c_str()); + Log::log(" linkedReverseVars:"); + FOR_EACH (StringMap::const_iterator, + it, + wi.linkedReverseVars) + { + Log::log("%s -> %s ", + ((*it).first).c_str(), + ((*it).second).c_str()); + } } Log::log("\n"); } |