From e228f65119bef5ba2e0a26c0f9c53d5c3f131463 Mon Sep 17 00:00:00 2001 From: Arseniy-Movshev Date: Sun, 28 May 2023 14:08:57 +0100 Subject: Allow sensorlogd to set up its directory structure This code sets up all the paths used by sensorlogd before it is started --- daemon/logger.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'daemon/logger.cpp') diff --git a/daemon/logger.cpp b/daemon/logger.cpp index 56d1c3c..7222c95 100644 --- a/daemon/logger.cpp +++ b/daemon/logger.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -116,3 +117,8 @@ QStringList fileGetPrevRecord(QString sensorPrefix, QDateTime recordTime) { QString fileNameForDate(QDate date, QString prefix) { return QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/asteroid-healthloggerd/" + prefix + "/" + date.toString("yyyy-MM-dd.log"); } + +void setupFilePath(QString sensorPrefix) { + QDir().mkpath(QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/asteroid-healthloggerd/" + sensorPrefix); +} + -- cgit v1.2.3-54-g00ecf