mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 23:28:14 +03:00
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:
parent
c7bf09c3d4
commit
f6a543ada3
1 changed files with 6 additions and 1 deletions
|
@ -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 )
|
||||
|
|
Loading…
Reference in a new issue