Expose more of the logger state
authorKevin Ottens <kevin.ottens@nextcloud.com>
Mon, 5 Oct 2020 17:36:25 +0000 (19:36 +0200)
committerMichael Schuster (Rebase PR Action) <misch7@users.noreply.github.com>
Wed, 7 Oct 2020 13:33:20 +0000 (13:33 +0000)
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 <kevin.ottens@nextcloud.com>
src/libsync/logger.cpp
src/libsync/logger.h

index 6827308e1acccc23bfe04fda9a111f93c51a82a7..d5d2048314c2ec49ec98618e6c1e53d5e551dffb 100644 (file)
@@ -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;
index 5f32a8a0d8730b724e29e1adf02b6c882c7f3077..12973c71c1a4079cf0b61af75a94d256e4cff0be 100644 (file)
@@ -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; }