From 607347289ea3eb03b59bb72c75b9552a34d7b787 Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Mon, 5 Oct 2020 19:36:25 +0200 Subject: [PATCH] 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 --- src/libsync/logger.cpp | 10 ++++++++++ src/libsync/logger.h | 6 ++++++ 2 files changed, 16 insertions(+) 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; } -- 2.30.2