Commit 7033f160 authored by Kevin Ottens's avatar Kevin Ottens Committed by backportbot[bot]

Allow to control logFlush from the config file

Signed-off-by: default avatarKevin Ottens <kevin.ottens@nextcloud.com>
parent d0848533
......@@ -411,7 +411,7 @@ void Application::setupLogging()
logger->setLogFile(_logFile);
logger->setLogDir(!_logDir.isEmpty() ? _logDir : ConfigFile().logDir());
logger->setLogExpire(_logExpire > 0 ? _logExpire : ConfigFile().logExpire());
logger->setLogFlush(_logFlush);
logger->setLogFlush(_logFlush || ConfigFile().logFlush());
logger->setLogDebug(_logDebug || ConfigFile().logDebug());
if (!logger->isLoggingToFile() && ConfigFile().automaticLogDir()) {
logger->setupTemporaryFolderLogDir();
......
......@@ -76,6 +76,7 @@ static const char automaticLogDirC[] = "logToTemporaryLogDir";
static const char logDirC[] = "logDir";
static const char logDebugC[] = "logDebug";
static const char logExpireC[] = "logExpire";
static const char logFlushC[] = "logFlush";
static const char proxyHostC[] = "Proxy/host";
static const char proxyTypeC[] = "Proxy/type";
......@@ -892,6 +893,18 @@ void ConfigFile::setLogExpire(int hours)
settings.setValue(QLatin1String(logExpireC), hours);
}
bool ConfigFile::logFlush() const
{
QSettings settings(configFile(), QSettings::IniFormat);
return settings.value(QLatin1String(logFlushC), false).toBool();
}
void ConfigFile::setLogFlush(bool enabled)
{
QSettings settings(configFile(), QSettings::IniFormat);
settings.setValue(QLatin1String(logFlushC), enabled);
}
QString ConfigFile::certificatePath() const
{
return retrieveData(QString(), QLatin1String(certPath)).toString();
......
......@@ -101,6 +101,9 @@ public:
int logExpire() const;
void setLogExpire(int hours);
bool logFlush() const;
void setLogFlush(bool enabled);
// proxy settings
void setProxyType(int proxyType,
const QString &host = QString(),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment