diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2016-09-20 07:58:39 -0700 |
---|---|---|
committer | Patrick Ohly <patrick.ohly@intel.com> | 2016-09-26 12:58:26 +0200 |
commit | 2ad9a45d453e89c79490886a4d5e1b5baf7415c7 (patch) | |
tree | c75a11e4ffdf7f4ccda79db49b466f946fa0ae91 /src | |
parent | 5638b9ed3fee1dde21e9ce3e011f432b2872e2c0 (diff) |
Cmdline.cpp: optionally show debug output in --version output
SYNCEVOLUTION_DEBUG=1 syncevolution --daemon=no --version now
dumps also the debug information gathered by the binary
compatibility code. It was only available in sync logs before.
Diffstat (limited to 'src')
-rw-r--r-- | src/syncevo/Cmdline.cpp | 5 | ||||
-rw-r--r-- | src/syncevo/SyncSource.cpp | 8 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/syncevo/Cmdline.cpp b/src/syncevo/Cmdline.cpp index d3d2da15..c416cc22 100644 --- a/src/syncevo/Cmdline.cpp +++ b/src/syncevo/Cmdline.cpp @@ -731,11 +731,12 @@ bool Cmdline::run() { if (m_usage) { usage(true); } else if (m_version) { + bool debug = atoi(getEnv("SYNCEVOLUTION_DEBUG", "0")) >= 1; SE_LOG_SHOW(NULL, "SyncEvolution %s%s\n%s%s", VERSION, SyncContext::isStableRelease() ? "" : " (pre-release)", - EDSAbiWrapperInfo(), - SyncSource::backendsInfo().c_str()); + debug ? EDSAbiWrapperDebug() : EDSAbiWrapperInfo(), + debug ? SyncSource::backendsDebug().c_str() : SyncSource::backendsInfo().c_str()); } else if (m_printServers || boost::trim_copy(m_server) == "?") { dumpConfigs("Configured servers:", SyncConfig::getConfigs()); diff --git a/src/syncevo/SyncSource.cpp b/src/syncevo/SyncSource.cpp index ae748ecc..5b9c40c9 100644 --- a/src/syncevo/SyncSource.cpp +++ b/src/syncevo/SyncSource.cpp @@ -403,7 +403,7 @@ public: } } if (!replacement.empty()) { - debug << "Skipping " << basename << " = " << fullpath << " because a more recent version of it was already loaded: " << replacement; + debug << "Skipping " << basename << " = " << fullpath << " because a more recent version of it was already loaded: " << replacement << endl; continue; } @@ -416,11 +416,11 @@ public: void *dlhandle = dlopen(fullpath.c_str(), RTLD_LAZY|RTLD_GLOBAL); // remember which modules were found and which were not if (dlhandle) { - debug<<"Loading backend library "<<basename<<endl; - info<<"Loading backend library "<<fullpath<<endl; + debug<<"Loaded backend library "<<basename<<endl; + info<<"Loaded backend library "<<fullpath<<endl; m_available.push_back(basename); } else { - debug<<"Loading backend library "<<basename<<"failed "<< dlerror()<<endl; + debug<<"Loading backend library "<<basename<<" failed: "<< dlerror()<<endl; } } #endif |