mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 09:30:13 +03:00
Change the defaults for logging
Turn on the logging by default for everyone. Let's use a log dir within the config directory of the application and have debug logs expiring after a day. This obviously means we'll generate quite some logs but with the automated compression it shouldn't be too horrible. Obviously that scales with the amount of files and syncs occurring. In our tests with a large setup we're around 100 MB for a day worth of logs, this shouldn't be too much of an issue on today's average desktop/laptop. Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
This commit is contained in:
parent
f90ae66d94
commit
b0a38816fc
1 changed files with 4 additions and 3 deletions
|
@ -901,8 +901,9 @@ void ConfigFile::setAutomaticLogDir(bool enabled)
|
|||
|
||||
QString ConfigFile::logDir() const
|
||||
{
|
||||
const auto defaultLogDir = QString(configPath() + QStringLiteral("/logs"));
|
||||
QSettings settings(configFile(), QSettings::IniFormat);
|
||||
return settings.value(QLatin1String(logDirC), QString()).toString();
|
||||
return settings.value(QLatin1String(logDirC), defaultLogDir).toString();
|
||||
}
|
||||
|
||||
void ConfigFile::setLogDir(const QString &dir)
|
||||
|
@ -914,7 +915,7 @@ void ConfigFile::setLogDir(const QString &dir)
|
|||
bool ConfigFile::logDebug() const
|
||||
{
|
||||
QSettings settings(configFile(), QSettings::IniFormat);
|
||||
return settings.value(QLatin1String(logDebugC), false).toBool();
|
||||
return settings.value(QLatin1String(logDebugC), true).toBool();
|
||||
}
|
||||
|
||||
void ConfigFile::setLogDebug(bool enabled)
|
||||
|
@ -926,7 +927,7 @@ void ConfigFile::setLogDebug(bool enabled)
|
|||
int ConfigFile::logExpire() const
|
||||
{
|
||||
QSettings settings(configFile(), QSettings::IniFormat);
|
||||
return settings.value(QLatin1String(logExpireC), 0).toBool();
|
||||
return settings.value(QLatin1String(logExpireC), 24).toBool();
|
||||
}
|
||||
|
||||
void ConfigFile::setLogExpire(int hours)
|
||||
|
|
Loading…
Reference in a new issue