From: Kevin Ottens Date: Mon, 5 Oct 2020 17:36:25 +0000 (+0200) Subject: Expose more of the logger state X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~22^2~121^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=607347289ea3eb03b59bb72c75b9552a34d7b787;p=nextcloud-desktop.git Expose more of the logger state It is better to rely on the Logger state to know exactly where we're logging. Indeed due to the the various ways to impact its state the config alone might not now where we're logging. Signed-off-by: Kevin Ottens --- diff --git a/src/libsync/logger.cpp b/src/libsync/logger.cpp index 6827308e1..d5d204831 100644 --- a/src/libsync/logger.cpp +++ b/src/libsync/logger.cpp @@ -167,6 +167,11 @@ void Logger::setLogWindowActivated(bool activated) _logWindowActivated = activated; } +QString Logger::logFile() const +{ + return _logFile.fileName(); +} + void Logger::setLogFile(const QString &name) { QMutexLocker locker(&_mutex); @@ -204,6 +209,11 @@ void Logger::setLogExpire(int expire) _logExpire = expire; } +QString Logger::logDir() const +{ + return _logDirectory; +} + void Logger::setLogDir(const QString &dir) { _logDirectory = dir; diff --git a/src/libsync/logger.h b/src/libsync/logger.h index 5f32a8a0d..12973c71c 100644 --- a/src/libsync/logger.h +++ b/src/libsync/logger.h @@ -60,9 +60,15 @@ public: void postGuiMessage(const QString &title, const QString &message); void setLogWindowActivated(bool activated); + + QString logFile() const; void setLogFile(const QString &name); + void setLogExpire(int expire); + + QString logDir() const; void setLogDir(const QString &dir); + void setLogFlush(bool flush); bool logDebug() const { return _logDebug; }