summaryrefslogtreecommitdiff
path: root/daemon/logger.cpp
diff options
context:
space:
mode:
authorArseniy-Movshev <dodoradio@outlook.com>2023-05-28 14:08:57 +0100
committerArseniy-Movshev <dodoradio@outlook.com>2023-05-28 15:43:22 +0100
commite228f65119bef5ba2e0a26c0f9c53d5c3f131463 (patch)
treecbe6d40a2e4e5b23f1022bc3180d55712c207990 /daemon/logger.cpp
parent521c01825badf77c65a1389109e2f4967cde154d (diff)
Allow sensorlogd to set up its directory structure
This code sets up all the paths used by sensorlogd before it is started
Diffstat (limited to 'daemon/logger.cpp')
-rw-r--r--daemon/logger.cpp6
1 files changed, 6 insertions, 0 deletions
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 <QDBusConnection>
#include <QDateTime>
#include <QFile>
+#include <QDir>
#include <QTextStream>
#include <QStandardPaths>
#include <QTimer>
@@ -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);
+}
+