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.
This commit is contained in:
Olivier Goffart 2015-10-22 00:20:13 +02:00
parent c7bf09c3d4
commit f6a543ada3

View file

@ -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 )