Commit 727c1e9e authored by Kevin Ottens's avatar Kevin Ottens Committed by backportbot[bot]

Allow to control log debug from the config file

Signed-off-by: default avatarKevin Ottens <kevin.ottens@nextcloud.com>
parent 7a767537
......@@ -412,7 +412,7 @@ void Application::setupLogging()
logger->setLogDir(_logDir);
logger->setLogExpire(_logExpire);
logger->setLogFlush(_logFlush);
logger->setLogDebug(_logDebug);
logger->setLogDebug(_logDebug || ConfigFile().logDebug());
if (!logger->isLoggingToFile() && ConfigFile().automaticLogDir()) {
logger->setupTemporaryFolderLogDir();
}
......
......@@ -73,6 +73,7 @@ static const char minChunkSizeC[] = "minChunkSize";
static const char maxChunkSizeC[] = "maxChunkSize";
static const char targetChunkUploadDurationC[] = "targetChunkUploadDuration";
static const char automaticLogDirC[] = "logToTemporaryLogDir";
static const char logDebugC[] = "logDebug";
static const char proxyHostC[] = "Proxy/host";
static const char proxyTypeC[] = "Proxy/type";
......@@ -853,6 +854,18 @@ void ConfigFile::setAutomaticLogDir(bool enabled)
settings.setValue(QLatin1String(automaticLogDirC), enabled);
}
bool ConfigFile::logDebug() const
{
QSettings settings(configFile(), QSettings::IniFormat);
return settings.value(QLatin1String(logDebugC), false).toBool();
}
void ConfigFile::setLogDebug(bool enabled)
{
QSettings settings(configFile(), QSettings::IniFormat);
settings.setValue(QLatin1String(logDebugC), enabled);
}
QString ConfigFile::certificatePath() const
{
return retrieveData(QString(), QLatin1String(certPath)).toString();
......
......@@ -92,6 +92,9 @@ public:
bool automaticLogDir() const;
void setAutomaticLogDir(bool enabled);
bool logDebug() const;
void setLogDebug(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