[Pkg-owncloud-commits] [owncloud-client] 126/484: Logger: speedup the sync discovery when the log is innactive

Sandro Knauß hefee-guest at moszumanska.debian.org
Wed Dec 16 00:37:28 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit f6a543ada3288eada9178d618235195027db91b7
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Thu Oct 22 00:20:13 2015 +0200

    Logger: speedup the sync discovery when the log is innactive
    
    The sync throw a lot of log message, and QDateTime::fromCurrentTime is
    quite expensive. So don't call it if it's not needed.
---
 src/libsync/logger.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/libsync/logger.cpp b/src/libsync/logger.cpp
index d4767dc..ab2b525 100644
--- a/src/libsync/logger.cpp
+++ b/src/libsync/logger.cpp
@@ -141,12 +141,17 @@ void Logger::doLog(const QString& msg)
 
 void Logger::csyncLog( const QString& message )
 {
+    auto logger = Logger::instance();
+    if (logger->isNoop()) {
+        return;
+    }
+
     Log log;
     log.source = Log::CSync;
     log.timeStamp = QDateTime::currentDateTime();
     log.message = message;
 
-    Logger::instance()->log(log);
+    logger->log(log);
 }
 
 void Logger::mirallLog( const QString& message )

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list