mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Allow to control logExpire from the config file
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
This commit is contained in:
parent
808fb17809
commit
be2d9d4838
@ -409,7 +409,7 @@ void Application::setupLogging()
|
||||
auto logger = Logger::instance();
|
||||
logger->setLogFile(_logFile);
|
||||
logger->setLogDir(_logDir);
|
||||
logger->setLogExpire(_logExpire);
|
||||
logger->setLogExpire(_logExpire > 0 ? _logExpire : ConfigFile().logExpire());
|
||||
logger->setLogFlush(_logFlush);
|
||||
logger->setLogDebug(_logDebug || ConfigFile().logDebug());
|
||||
if (!logger->isLoggingToFile() && ConfigFile().automaticLogDir()) {
|
||||
|
||||
@ -74,6 +74,7 @@ static const char maxChunkSizeC[] = "maxChunkSize";
|
||||
static const char targetChunkUploadDurationC[] = "targetChunkUploadDuration";
|
||||
static const char automaticLogDirC[] = "logToTemporaryLogDir";
|
||||
static const char logDebugC[] = "logDebug";
|
||||
static const char logExpireC[] = "logExpire";
|
||||
|
||||
static const char proxyHostC[] = "Proxy/host";
|
||||
static const char proxyTypeC[] = "Proxy/type";
|
||||
@ -866,6 +867,18 @@ void ConfigFile::setLogDebug(bool enabled)
|
||||
settings.setValue(QLatin1String(logDebugC), enabled);
|
||||
}
|
||||
|
||||
int ConfigFile::logExpire() const
|
||||
{
|
||||
QSettings settings(configFile(), QSettings::IniFormat);
|
||||
return settings.value(QLatin1String(logExpireC), 0).toBool();
|
||||
}
|
||||
|
||||
void ConfigFile::setLogExpire(int hours)
|
||||
{
|
||||
QSettings settings(configFile(), QSettings::IniFormat);
|
||||
settings.setValue(QLatin1String(logExpireC), hours);
|
||||
}
|
||||
|
||||
QString ConfigFile::certificatePath() const
|
||||
{
|
||||
return retrieveData(QString(), QLatin1String(certPath)).toString();
|
||||
|
||||
@ -95,6 +95,9 @@ public:
|
||||
bool logDebug() const;
|
||||
void setLogDebug(bool enabled);
|
||||
|
||||
int logExpire() const;
|
||||
void setLogExpire(int hours);
|
||||
|
||||
// proxy settings
|
||||
void setProxyType(int proxyType,
|
||||
const QString &host = QString(),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user