Folder: set csync verbosity to 0 if the Logger is not there
authorOlivier Goffart <ogoffart@woboq.com>
Wed, 21 Oct 2015 23:13:35 +0000 (01:13 +0200)
committerOlivier Goffart <ogoffart@woboq.com>
Wed, 21 Oct 2015 23:13:35 +0000 (01:13 +0200)
csync_log was still accounting for 8% of the local discovery (because
of vsnprintf and asprintf)

src/gui/folder.cpp

index 226e501bbd8cba741ad7d4b7a8e5fb443286ee94..fbd6a2adc2873dca9538b9c4621a11bc021c391b 100644 (file)
@@ -108,7 +108,7 @@ bool Folder::init()
         _csync_ctx = 0;
     } else {
         csync_set_log_callback( csyncLogCatcher );
-        csync_set_log_level( 11 );
+        csync_set_log_level( Logger::instance()->isNoop() ? 0 : 11 );
 
         Q_ASSERT( _accountState );
         _accountState->account()->credentials()->syncContextPreInit(_csync_ctx);
@@ -844,6 +844,7 @@ void Folder::startSync(const QStringList &pathList)
         _clientProxy.setCSyncProxy(_accountState->account()->url(), _csync_ctx);
         setProxyDirty(false);
     }
+    csync_set_log_level( Logger::instance()->isNoop() ? 0 : 11 );
 
     if (isBusy()) {
         qCritical() << "* ERROR csync is still running and new sync requested.";