Skip to content

Commit

Permalink
[KDESKTOP-240] Delete logs only after 7 days
Browse files Browse the repository at this point in the history
  • Loading branch information
luc-guyot-infomaniak committed Mar 22, 2024
1 parent 64071b2 commit 381c548
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/gui/appclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ void AppClient::setupLogging() {

logger->setupTemporaryFolderLogDir();
if (ParametersCache::instance()->parametersInfo().purgeOldLogs()) {
logger->setLogExpire(std::chrono::hours(24));
logger->setLogExpire(std::chrono::hours(ClientGui::logsPurgeRate() * 24));
} else {
logger->setLogExpire(std::chrono::hours(0));
}
Expand Down
3 changes: 2 additions & 1 deletion src/gui/clientgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "parametersdialog.h"
#include "adddrivewizard.h"
#include "logindialog.h"
#include "common/utility.h"
#include "info/userinfoclient.h"
#include "info/accountinfo.h"
#include "info/driveinfoclient.h"
Expand Down Expand Up @@ -81,6 +80,8 @@ class ClientGui : public QObject, public std::enable_shared_from_this<ClientGui>
void errorInfoList(int driveDbId, QList<ErrorInfo> &errorInfoList);
void resolveConflictErrors(int driveDbId, bool keepLocalVersion);
void resolveUnsupportedCharErrors(int driveDbId);
// Delay after which the logs are purged, expressed in days.
static constexpr int logsPurgeRate() { return 7; };

signals:
void userListRefreshed();
Expand Down
2 changes: 1 addition & 1 deletion src/gui/debuggingdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void DebuggingDialog::initUI() {

_deleteLogsCheckBox = new CustomCheckBox(this);
_deleteLogsCheckBox->setObjectName("deleteLogsCheckBox");
_deleteLogsCheckBox->setText(tr("Delete logs older than %1 hours").arg(24));
_deleteLogsCheckBox->setText(tr("Delete logs older than %1 days").arg(ClientGui::logsPurgeRate()));
deleteLogsHBox->addWidget(_deleteLogsCheckBox);

mainLayout->addStretch();
Expand Down

0 comments on commit 381c548

Please sign in to comment.